1
0
Fork 0

flakes: update

This commit is contained in:
Antoine Langlois 2024-05-07 20:30:21 +02:00
parent 0b7eb785be
commit c413d9d62c
Signed by: DataHearth
GPG Key ID: ABF6737C63396D35
8 changed files with 108 additions and 204 deletions

View File

@ -92,11 +92,11 @@
]
},
"locked": {
"lastModified": 1712014858,
"narHash": "sha256-sB4SWl2lX95bExY2gMFG5HIzvva5AVMJd4Igm+GpZNw=",
"lastModified": 1714641030,
"narHash": "sha256-yzcRNDoyVP7+SCNX0wmuDju1NUCt8Dz9+lyUXEI0dbI=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "9126214d0a59633752a136528f5f3b9aa8565b7d",
"rev": "e5d10a24b66c3ea8f150e47dfdb0416ab7c3390e",
"type": "github"
},
"original": {
@ -125,7 +125,7 @@
},
"flake-utils_2": {
"inputs": {
"systems": "systems_6"
"systems": "systems_4"
},
"locked": {
"lastModified": 1709126324,
@ -142,7 +142,7 @@
},
"flake-utils_3": {
"inputs": {
"systems": "systems_7"
"systems": "systems_5"
},
"locked": {
"lastModified": 1701680307,
@ -160,7 +160,7 @@
},
"flake-utils_4": {
"inputs": {
"systems": "systems_8"
"systems": "systems_6"
},
"locked": {
"lastModified": 1710146030,
@ -205,11 +205,11 @@
]
},
"locked": {
"lastModified": 1714515075,
"narHash": "sha256-azMK7aWH0eUc3IqU4Fg5rwZdB9WZBvimOGG3piqvtsY=",
"lastModified": 1715077503,
"narHash": "sha256-AfHQshzLQfUqk/efMtdebHaQHqVntCMjhymQzVFLes0=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "6d3b6dc9222c12b951169becdf4b0592ee9576ef",
"rev": "6e277d9566de9976f47228dd8c580b97488734d4",
"type": "github"
},
"original": {
@ -226,11 +226,11 @@
]
},
"locked": {
"lastModified": 1714343445,
"narHash": "sha256-OzD1P0o46uD3Ix4ZI/g9z3YAeg+4g+W3qctB6bNOReo=",
"lastModified": 1714679908,
"narHash": "sha256-KzcXzDvDJjX34en8f3Zimm396x6idbt+cu4tWDVS2FI=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "9fe79591c1005ce6f93084ae7f7dab0a2891440d",
"rev": "9036fe9ef8e15a819fa76f47a8b1f287903fb848",
"type": "github"
},
"original": {
@ -239,32 +239,10 @@
"type": "github"
}
},
"hypridle": {
"inputs": {
"hyprlang": "hyprlang",
"nixpkgs": [
"nixpkgs"
],
"systems": "systems_3"
},
"locked": {
"lastModified": 1713472482,
"narHash": "sha256-7Ft5WZTMIjXOGgRCf31DZBwK6RK8xkeKlD5vFXz3gII=",
"owner": "hyprwm",
"repo": "hypridle",
"rev": "7cff4581a3753154fc5b41f39a098fad49b777b1",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hypridle",
"type": "github"
}
},
"hyprlang": {
"inputs": {
"nixpkgs": [
"hypridle",
"hyprlock",
"nixpkgs"
],
"systems": "systems_2"
@ -283,42 +261,20 @@
"type": "github"
}
},
"hyprlang_2": {
"inputs": {
"nixpkgs": [
"hyprlock",
"nixpkgs"
],
"systems": "systems_4"
},
"locked": {
"lastModified": 1713121246,
"narHash": "sha256-502X0Q0fhN6tJK7iEUA8CghONKSatW/Mqj4Wappd++0=",
"owner": "hyprwm",
"repo": "hyprlang",
"rev": "78fcaa27ae9e1d782faa3ff06c8ea55ddce63706",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprlang",
"type": "github"
}
},
"hyprlock": {
"inputs": {
"hyprlang": "hyprlang_2",
"hyprlang": "hyprlang",
"nixpkgs": [
"nixpkgs"
],
"systems": "systems_5"
"systems": "systems_3"
},
"locked": {
"lastModified": 1713978374,
"narHash": "sha256-jla5Wo0Qt3NEnD0OjNj85BGw0pR4Zlz5uy8AqHH7tuE=",
"lastModified": 1714843107,
"narHash": "sha256-89WxndRGO3CGuWE5XCaHKnsV3IKBRdOWqScp6o8enT4=",
"owner": "hyprwm",
"repo": "hyprlock",
"rev": "415262065fff0a04b229cd00165f346a86a0a73a",
"rev": "c87af3aa1f6e6bd06cffaabcc400bd45e26d565a",
"type": "github"
},
"original": {
@ -405,11 +361,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1714253743,
"narHash": "sha256-mdTQw2XlariysyScCv2tTE45QSU9v/ezLcHJ22f0Nxc=",
"lastModified": 1714906307,
"narHash": "sha256-UlRZtrCnhPFSJlDQE7M0eyhgvuuHBTe1eJ9N9AQlJQ0=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "58a1abdbae3217ca6b702f03d3b35125d88a2994",
"rev": "25865a40d14b3f9cf19f19b924e2ab4069b09588",
"type": "github"
},
"original": {
@ -432,11 +388,11 @@
"pre-commit-hooks": "pre-commit-hooks"
},
"locked": {
"lastModified": 1714494971,
"narHash": "sha256-7RsTiRKMMrlwuert1QNFvnoPIwl1q1cepR4H8jv2iok=",
"lastModified": 1715093176,
"narHash": "sha256-zb0hnSNnniskSB/B9r3+zjQyJTwLT84Vm4WMz/v2ErI=",
"owner": "nix-community",
"repo": "nixvim",
"rev": "2483dff03dd326296278213a8e051d375b56d3df",
"rev": "b731bedfb9a75f9d25da4d8e97a95f03eb863274",
"type": "github"
},
"original": {
@ -460,11 +416,11 @@
]
},
"locked": {
"lastModified": 1713954846,
"narHash": "sha256-RWFafuSb5nkWGu8dDbW7gVb8FOQOPqmX/9MlxUUDguw=",
"lastModified": 1714478972,
"narHash": "sha256-q//cgb52vv81uOuwz1LaXElp3XAe1TqrABXODAEF6Sk=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "6fb82e44254d6a0ece014ec423cb62d92435336f",
"rev": "2849da033884f54822af194400f8dff435ada242",
"type": "github"
},
"original": {
@ -477,7 +433,6 @@
"inputs": {
"flake-utils": "flake-utils",
"home-manager": "home-manager",
"hypridle": "hypridle",
"hyprlock": "hyprlock",
"mac-app-util": "mac-app-util",
"nix-darwin": "nix-darwin",
@ -532,31 +487,31 @@
},
"systems_4": {
"locked": {
"lastModified": 1689347949,
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default-linux",
"rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default-linux",
"repo": "default",
"type": "github"
}
},
"systems_5": {
"locked": {
"lastModified": 1689347949,
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default-linux",
"rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default-linux",
"repo": "default",
"type": "github"
}
},
@ -574,36 +529,6 @@
"repo": "default",
"type": "github"
}
},
"systems_7": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_8": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",

View File

@ -20,29 +20,14 @@
url = "github:hyprwm/hyprlock";
inputs.nixpkgs.follows = "nixpkgs";
};
hypridle = {
url = "github:hyprwm/hypridle";
inputs.nixpkgs.follows = "nixpkgs";
};
mac-app-util.url = "github:hraban/mac-app-util";
};
outputs = inputs@{
self,
nixpkgs,
nix-darwin,
home-manager,
nixvim,
hyprlock,
hypridle,
mac-app-util,
...
}:
{
outputs = inputs@{ self, nixpkgs, nix-darwin, home-manager, nixvim, ... }: {
nixosConfigurations = {
antoine-nixos = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit hyprlock hypridle; };
specialArgs = { inherit inputs; };
modules = [
./hosts/antoine-nixos/configuration.nix
home-manager.nixosModules.home-manager
@ -50,11 +35,11 @@
];
};
};
darwinConfigurations = {
antoine-macbookpro = nix-darwin.lib.darwinSystem {
system = "x86_64-darwin";
specialArgs = { inherit inputs hyprlock hypridle mac-app-util; };
specialArgs = { inherit inputs; };
modules = [
./hosts/antoine-macbookpro/configuration.nix
home-manager.darwinModules.home-manager

View File

@ -1,17 +1,15 @@
{ inputs, pkgs, lib, hyprlock, hypridle, mac-app-util, ... }: {
{ pkgs, lib, inputs, ... }: {
imports = [ ./services.nix ../../modules/neovim ];
# Nix
nix.settings.experimental-features = "nix-command flakes";
nixpkgs.hostPlatform = "x86_64-darwin";
nixpkgs.config.allowUnfree = true;
nixpkgs.config.permittedInsecurePackages = [ "nix-2.16.2" ];
# System
system.stateVersion = 4;
system.configurationRevision = inputs.rev or inputs.dirtyRev or null;
environment.systemPackages = with pkgs; [ ];
environment.shells = with pkgs; [ zsh ];
users.users.antoine = {
@ -20,7 +18,7 @@
shell = pkgs.zsh;
};
home-manager = {
extraSpecialArgs = { inherit inputs hyprlock hypridle mac-app-util; };
extraSpecialArgs = { inherit inputs; };
useGlobalPkgs = true;
useUserPackages = true;
users = { "antoine" = import ./home-manager/home.nix; };

View File

@ -1,10 +1,9 @@
{ pkgs, hyprlock, hypridle, mac-app-util, ... }: {
{ pkgs, inputs, ... }: {
imports = [
../../shared/hm.nix
hyprlock.homeManagerModules.default
hypridle.homeManagerModules.default
mac-app-util.homeManagerModules.default
inputs.mac-app-util.homeManagerModules.default
inputs.hyprlock.homeManagerModules.default
] ++ (import ../../../modules/home-manager);
home.packages = with pkgs; [ pinentry_mac ];

View File

@ -1,4 +1,4 @@
{ pkgs, lib, hyprlock, hypridle, ... }: {
{ pkgs, lib, inputs, ... }: {
imports = [
# Modules
../../modules/linux/passthrough.nix
@ -86,9 +86,6 @@
environment = {
shells = with pkgs; [ zsh bash ];
# variables = {
# KWIN_DRM_USE_MODIFIERS = "0";
# };
systemPackages = with pkgs; [
networkmanagerapplet
pinentry
@ -113,7 +110,7 @@
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = { inherit hyprlock hypridle; };
extraSpecialArgs = { inherit inputs; };
users = { "datahearth" = import ./home-manager/home.nix; };
};

View File

@ -1,15 +1,15 @@
{ pkgs, hyprlock, hypridle, ... }: {
{ pkgs, inputs, ... }: {
imports = let
modules_base_path = ../../../modules;
modules_hm_path = modules_base_path + "/home-manager";
in [
inputs.hyprlock.homeManagerModules.default
"${modules_hm_path}/looking-glass"
"${modules_hm_path}/vscode"
../../shared/hm.nix
./services.nix
hyprlock.homeManagerModules.default
hypridle.homeManagerModules.default
] ++ (import ../../../modules/home-manager);
qt = {

View File

@ -1,49 +1,48 @@
{ config, options, lib, ... }:
with lib;
{ config, lib, ... }:
let
cfg = config.hm.hypridle;
enable = mkEnableOption "hypridle";
enable = lib.mkEnableOption "hypridle";
enabledListeners = {
brightness = mkOption {
type = types.bool;
brightness = lib.mkOption {
type = lib.types.bool;
description = "Enable brightness control";
default = true;
};
lock = mkOption {
type = types.bool;
lock = lib.mkOption {
type = lib.types.bool;
description = "Enable lock control";
default = true;
};
monitors = mkOption {
type = types.bool;
monitors = lib.mkOption {
type = lib.types.bool;
description = "Enable monitors control";
default = true;
};
suspend = mkOption {
type = types.bool;
suspend = lib.mkOption {
type = lib.types.bool;
description = "Enable suspend control";
default = true;
};
};
timeouts = {
lowerBrightness = mkOption {
type = types.int;
lowerBrightness = lib.mkOption {
type = lib.types.int;
description = "Duration before screens brightness is lowered";
default = 120;
};
lock = mkOption {
type = types.int;
lock = lib.mkOption {
type = lib.types.int;
description = "Duration before locking session";
default = 180;
};
displaysOff = mkOption {
type = types.int;
displaysOff = lib.mkOption {
type = lib.types.int;
description = "Duration before screens are turned off";
default = 210;
};
suspend = mkOption {
type = types.int;
suspend = lib.mkOption {
type = lib.types.int;
description = "Duration before suspendind sessions";
default = 300;
};
@ -51,33 +50,35 @@ let
in {
options.hm.hypridle = { inherit enable timeouts enabledListeners; };
config = mkIf cfg.enable {
config = lib.mkIf cfg.enable {
services.hypridle = {
enable = true;
lockCmd = "pidof hyprlock || hyprlock";
unlockCmd = "";
beforeSleepCmd = "loginctl lock-session";
afterSleepCmd = "hyprctl dispatch dpms on";
listeners = [
(mkIf cfg.enabledListeners.brightness {
timeout = cfg.timeouts.lowerBrightness;
onTimeout = "brightnessctl -s set 10";
onResume = "brightnessctl -r";
})
(mkIf cfg.enabledListeners.lock {
timeout = cfg.timeouts.lock;
onTimeout = "pidof hyprlock || hyprlock";
})
(mkIf cfg.enabledListeners.monitors {
timeout = cfg.timeouts.displaysOff;
onTimeout = "hyprctl dispatch dpms off";
onResume = "hyprctl dispatch dpms on";
})
(mkIf cfg.enabledListeners.suspend {
timeout = cfg.timeouts.suspend;
onTimeout = "systemctl suspend";
})
];
settings = {
lock_cmd = "pidof hyprlock || hyprlock";
unlock_cmd = "";
before_sleep_cmd = "loginctl lock-session";
after_sleep_cmd = "hyprctl dispatch dpms on";
listeners = [
(lib.mkIf cfg.enabledListeners.brightness {
timeout = cfg.timeouts.lowerBrightness;
on_timeout = "brightnessctl -s set 10";
on_resume = "brightnessctl -r";
})
(lib.mkIf cfg.enabledListeners.lock {
timeout = cfg.timeouts.lock;
on_timeout = "pidof hyprlock || hyprlock";
})
(lib.mkIf cfg.enabledListeners.monitors {
timeout = cfg.timeouts.displaysOff;
on_timeout = "hyprctl dispatch dpms off";
on_resume = "hyprctl dispatch dpms on";
})
(lib.mkIf cfg.enabledListeners.suspend {
timeout = cfg.timeouts.suspend;
on_timeout = "systemctl suspend";
})
];
};
};
};
}

View File

@ -1,16 +1,15 @@
{ config, options, lib, ... }:
with lib;
{ config, lib, ... }:
let
cfg = config.hm.hyprlock;
enable = mkEnableOption "hyprlock";
lockBackgroundImage = mkOption {
type = types.str;
enable = lib.mkEnableOption "hyprlock";
lockBackgroundImage = lib.mkOption {
type = lib.types.str;
description = "Path to background image for lock screen";
default = "";
};
defaultDisplay = mkOption {
type = types.str;
defaultDisplay = lib.mkOption {
type = lib.types.str;
description =
"Default display will have all labels and input-labels written on.";
default = "";
@ -18,13 +17,13 @@ let
in {
options.hm.hyprlock = { inherit enable lockBackgroundImage defaultDisplay; };
config = mkIf cfg.enable {
config = lib.mkIf cfg.enable {
programs.hyprlock = {
enable = true;
general.disable_loading_bar = true;
backgrounds = [{
path = mkIf (cfg.lockBackgroundImage != "") cfg.lockBackgroundImage;
path = lib.mkIf (cfg.lockBackgroundImage != "") cfg.lockBackgroundImage;
blur_passes = 3;
contrast = 0.8916;
brightness = 0.8172;
@ -33,7 +32,7 @@ in {
}];
input-fields = [{
monitor = mkIf (cfg.defaultDisplay != "") cfg.defaultDisplay;
monitor = lib.mkIf (cfg.defaultDisplay != "") cfg.defaultDisplay;
size = {
width = 250;
height = 60;
@ -54,7 +53,7 @@ in {
labels = [
{
monitor = mkIf (cfg.defaultDisplay != "") cfg.defaultDisplay;
monitor = lib.mkIf (cfg.defaultDisplay != "") cfg.defaultDisplay;
text = ''cmd[update:1000] echo "$TIME"'';
font_family = "Mononoki Nerd Font";
color = "rgba(255, 255, 255, 0.6)";
@ -66,7 +65,7 @@ in {
valign = "top";
}
{
monitor = mkIf (cfg.defaultDisplay != "") cfg.defaultDisplay;
monitor = lib.mkIf (cfg.defaultDisplay != "") cfg.defaultDisplay;
text = "Hello there, $USER";
font_family = "Mononoki Nerd Font";
color = "rgba(255, 255, 255, 0.6)";
@ -77,7 +76,7 @@ in {
};
}
{
monitor = mkIf (cfg.defaultDisplay != "") cfg.defaultDisplay;
monitor = lib.mkIf (cfg.defaultDisplay != "") cfg.defaultDisplay;
text = ''
cmd[update:1000] playerctl metadata --format "{{ artist }} - {{ album }} - {{ title }}"'';
color = "rgba(255, 255, 255, 0.6)";