diff --git a/flake.lock b/flake.lock index 8392c9c..8a13f83 100644 --- a/flake.lock +++ b/flake.lock @@ -21,6 +21,27 @@ "type": "github" } }, + "home-manager-unstable": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1691882297, + "narHash": "sha256-e1/LAQSGLnBywfA1TfMl0Vj3tvYka73XOZ/D2/CJowE=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "c3ab5ea047e6dc73df530948f7367455749d8906", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "master", + "repo": "home-manager", + "type": "github" + } + }, "impermanence": { "locked": { "lastModified": 1690797372, @@ -43,11 +64,11 @@ ] }, "locked": { - "lastModified": 1691292840, - "narHash": "sha256-NA+o/NoOOQhzAQwB2JpeKoG+iYQ6yn/XXVxaGd5HSQI=", + "lastModified": 1691897365, + "narHash": "sha256-jvWIU4ht3YAmF8TDVM2Ps2+Gf4MtNGLL1zEWQZdTrzU=", "owner": "nix-community", "repo": "nix-index-database", - "rev": "6c626d54d0414d34c771c0f6f9d771bc8aaaa3c4", + "rev": "f4d70d098f066a30c7087144063dca179495f7d6", "type": "github" }, "original": { @@ -58,11 +79,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1691592289, - "narHash": "sha256-Lqpw7lrXlLkYra33tp57ms8tZ0StWhbcl80vk4D90F8=", + "lastModified": 1691831739, + "narHash": "sha256-6e12VCvA7jOjhzJ1adLiUV1GTPXGBcCfhggsDwiuNB4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9034b46dc4c7596a87ab837bb8a07ef2d887e8c7", + "rev": "3fe694c4156b84dac12627685c7ae592a71e2206", "type": "github" }, "original": { @@ -72,12 +93,30 @@ "type": "github" } }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1691654369, + "narHash": "sha256-gSILTEx1jRaJjwZxRlnu3ZwMn1FVNk80qlwiCX8kmpo=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "ce5e4a6ef2e59d89a971bc434ca8ca222b9c7f5e", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "root": { "inputs": { "home-manager": "home-manager", + "home-manager-unstable": "home-manager-unstable", "impermanence": "impermanence", "nix-index-database": "nix-index-database", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "nixpkgs-unstable": "nixpkgs-unstable" } } }, diff --git a/flake.nix b/flake.nix index 48f57db..e917a4d 100644 --- a/flake.nix +++ b/flake.nix @@ -5,6 +5,9 @@ nixpkgs = { url = "github:NixOS/nixpkgs/nixos-23.05"; }; + nixpkgs-unstable = { + url = "github:NixOS/nixpkgs/nixos-unstable"; + }; impermanence = { url = "github:nix-community/impermanence"; }; @@ -16,6 +19,10 @@ url = "github:nix-community/home-manager/release-23.05"; inputs.nixpkgs.follows = "nixpkgs"; # use the same nixpkgs as the system }; + home-manager-unstable = { + url = "github:nix-community/home-manager/master"; + inputs.nixpkgs.follows = "nixpkgs"; # use the same nixpkgs as the system + }; }; outputs = { self, nixpkgs, ... }@inputs: { @@ -27,25 +34,19 @@ omega = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; specialArgs = inputs; # pass flake inputs to modules - modules = [ - ./hosts/omega - ]; + modules = [ ./hosts/omega ]; }; # Laptop zeta = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; specialArgs = inputs; # pass flake inputs to modules - modules = [ - ./hosts/zeta - ]; + modules = [ ./hosts/zeta ]; }; # Tor relay tor = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; specialArgs = inputs; # pass flake inputs to modules - modules = [ - ./hosts/tor - ]; + modules = [ ./hosts/tor ]; }; }; }; diff --git a/hosts/omega/default.nix b/hosts/omega/default.nix index 0711f6b..a32f86e 100644 --- a/hosts/omega/default.nix +++ b/hosts/omega/default.nix @@ -1,6 +1,7 @@ { ... }: { imports = [ ./hardware.nix + ../../overlays ../../modules/base ../../modules/desktop ]; diff --git a/hosts/omega/hardware.nix b/hosts/omega/hardware.nix index 4960879..77423ac 100644 --- a/hosts/omega/hardware.nix +++ b/hosts/omega/hardware.nix @@ -36,12 +36,12 @@ fileSystems."/mnt/C" = { device = "/dev/disk/by-label/C"; fsType = "ntfs-3g"; - options = [ "rw" "uid=1000"]; + options = [ "rw" "uid=1000" ]; }; fileSystems."/mnt/Backup" = { device = "/dev/disk/by-label/Backup"; fsType = "ntfs-3g"; - options = [ "rw" "uid=1000"]; + options = [ "rw" "uid=1000" ]; }; # Enables DHCP on all ethernet and wireless LAN interfaces. diff --git a/hosts/tor/default.nix b/hosts/tor/default.nix index b79c9ee..699041e 100644 --- a/hosts/tor/default.nix +++ b/hosts/tor/default.nix @@ -2,6 +2,7 @@ imports = [ ./hardware.nix ./tor.nix + ../../overlays ../../modules/base ../../modules/tor ]; diff --git a/hosts/zeta/default.nix b/hosts/zeta/default.nix index d3295bc..23437a5 100644 --- a/hosts/zeta/default.nix +++ b/hosts/zeta/default.nix @@ -1,6 +1,7 @@ { ... }: { imports = [ ./hardware.nix + ../../overlays ../../modules/base ../../modules/desktop ]; diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index 8f29767..cc49951 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -1,6 +1,7 @@ { pkgs, ... }: { imports = [ ./firefox.nix + ./kanshi.nix ./network.nix ./ssh.nix ./sway.nix diff --git a/modules/desktop/kanshi.nix b/modules/desktop/kanshi.nix new file mode 100644 index 0000000..7935499 --- /dev/null +++ b/modules/desktop/kanshi.nix @@ -0,0 +1,25 @@ +{ home-manager, lib, pkgs, ... }: { + # https://nix-community.github.io/home-manager/options.html + + home-manager.users.caspervk = { + services.kanshi = { + enable = true; + profiles = { + # Output names ("criteria") from `swaymsg -t get_outputs`. + home.outputs = [ + { + criteria = "ASUSTek COMPUTER INC ROG XG27AQ M3LMQS370969"; + mode = "2560x1440@144Hz"; + position = "0,0"; + adaptiveSync = true; + } + { + criteria = "BNQ BenQ XL2411Z SCD06385SL0"; + mode = "1920x1080@144Hz"; + position = "2560,0"; + } + ]; + }; + }; + }; +} diff --git a/overlays/default.nix b/overlays/default.nix new file mode 100644 index 0000000..61c403a --- /dev/null +++ b/overlays/default.nix @@ -0,0 +1,5 @@ +{ ... }: { + imports = [ + ./kanshi.nix + ]; +} diff --git a/overlays/kanshi.nix b/overlays/kanshi.nix new file mode 100644 index 0000000..d5507b1 --- /dev/null +++ b/overlays/kanshi.nix @@ -0,0 +1,14 @@ +{ home-manager, home-manager-unstable, nixpkgs-unstable, ... }: { + # adaptiveSync requires the unstable kanshi nixpkgs and home-manager module + + nixpkgs.overlays = [ + (self: super: { + kanshi = nixpkgs-unstable.legacyPackages.${super.system}.kanshi; + }) + ]; + + home-manager.users.caspervk = { + disabledModules = [ "${home-manager}/modules/services/kanshi.nix" ]; + imports = [ "${home-manager-unstable}/modules/services/kanshi.nix" ]; + }; +}