From 2d490033f361b8af4517020ed0452f6f54de8891 Mon Sep 17 00:00:00 2001 From: Zynh Ludwig Date: Wed, 11 Sep 2024 17:34:57 -0700 Subject: [PATCH] flake: add niri --- builders.nix | 6 +- flake.lock | 141 ++++++++++++++++++++++++++++++++++++++++++++++- flake.nix | 1 + modules/niri.nix | 16 ++++++ 4 files changed, 162 insertions(+), 2 deletions(-) create mode 100644 modules/niri.nix diff --git a/builders.nix b/builders.nix index 13595a2..803e274 100644 --- a/builders.nix +++ b/builders.nix @@ -5,7 +5,10 @@ let inherit system; config.allowUnfree = true; - overlays = [ self.overlays.default ]; + overlays = [ + self.overlays.default + inputs.niri.overlays.niri + ]; }); lib = nixpkgs.lib.extend (import ./lib); @@ -28,6 +31,7 @@ rec { ./hosts/${hostname}/hardware-configuration.nix ./hosts/${hostname}/configuration.nix inputs.home-manager.nixosModules.default + inputs.niri.nixosModules.niri { home-manager.extraSpecialArgs = { inherit inputs self pkgs; diff --git a/flake.lock b/flake.lock index f4302cb..0460691 100644 --- a/flake.lock +++ b/flake.lock @@ -126,6 +126,24 @@ "type": "indirect" } }, + "flake-parts_3": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1725234343, + "narHash": "sha256-+ebgonl3NbiKD2UD0x4BszCZQ6sTfL4xioaM49o5B3Y=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "567b938d64d4b4112ee253b9274472dc3a346eb6", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, "git-hooks": { "inputs": { "flake-compat": "flake-compat_2", @@ -258,6 +276,65 @@ "type": "github" } }, + "niri": { + "inputs": { + "flake-parts": "flake-parts_3", + "niri-stable": "niri-stable", + "niri-unstable": "niri-unstable", + "nixpkgs": [ + "nixpkgs" + ], + "nixpkgs-stable": "nixpkgs-stable", + "xwayland-satellite-stable": "xwayland-satellite-stable", + "xwayland-satellite-unstable": "xwayland-satellite-unstable" + }, + "locked": { + "lastModified": 1726061420, + "narHash": "sha256-nEjj3UZKg4W8K5XUwqR+WeuiND5Qw4xK1tD5h4GzJ8A=", + "owner": "sodiboo", + "repo": "niri-flake", + "rev": "74c0df9dca8d218120f57f83c51224bf36a472df", + "type": "github" + }, + "original": { + "owner": "sodiboo", + "repo": "niri-flake", + "type": "github" + } + }, + "niri-stable": { + "flake": false, + "locked": { + "lastModified": 1723290956, + "narHash": "sha256-13xynDWoOqogUKZTf6lz267hEQGdCE+BE6acs2G3j8k=", + "owner": "YaLTeR", + "repo": "niri", + "rev": "9063a5dbdc0d4470dc1e13ce5749838e32af6a44", + "type": "github" + }, + "original": { + "owner": "YaLTeR", + "ref": "v0.1.8", + "repo": "niri", + "type": "github" + } + }, + "niri-unstable": { + "flake": false, + "locked": { + "lastModified": 1725957188, + "narHash": "sha256-XjDbhHG2qxTmuX8rcIob4T7AM33NjgTA5QBcexjI0aU=", + "owner": "YaLTeR", + "repo": "niri", + "rev": "087a50a19c87175bc6c2a3b7ddc886f98f26f7c4", + "type": "github" + }, + "original": { + "owner": "YaLTeR", + "repo": "niri", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1725432240, @@ -274,7 +351,35 @@ "type": "github" } }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1725233747, + "narHash": "sha256-Ss8QWLXdr2JCBPcYChJhz4xJm+h/xjl4G0c0XlP6a74=", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/356624c12086a18f2ea2825fed34523d60ccc4e3.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/356624c12086a18f2ea2825fed34523d60ccc4e3.tar.gz" + } + }, "nixpkgs-stable": { + "locked": { + "lastModified": 1725930920, + "narHash": "sha256-RVhD9hnlTT2nJzPHlAqrWqCkA7T6CYrP41IoVRkciZM=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "44a71ff39c182edaf25a7ace5c9454e7cba2c658", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-stable_2": { "locked": { "lastModified": 1721524707, "narHash": "sha256-5NctRsoE54N86nWd0psae70YSLfrOek3Kv1e8KoXe/0=", @@ -312,6 +417,7 @@ "fish_theme": "fish_theme", "home-manager": "home-manager", "neovim-overlay": "neovim-overlay", + "niri": "niri", "nixpkgs": "nixpkgs", "repo-clone": "repo-clone", "sops-nix": "sops-nix" @@ -322,7 +428,7 @@ "nixpkgs": [ "nixpkgs" ], - "nixpkgs-stable": "nixpkgs-stable" + "nixpkgs-stable": "nixpkgs-stable_2" }, "locked": { "lastModified": 1725540166, @@ -337,6 +443,39 @@ "repo": "sops-nix", "type": "github" } + }, + "xwayland-satellite-stable": { + "flake": false, + "locked": { + "lastModified": 1718165778, + "narHash": "sha256-dwF9nI54a6Fo9XU5s4qmvMXSgCid3YQVGxch00qEMvI=", + "owner": "Supreeeme", + "repo": "xwayland-satellite", + "rev": "b6d281967cb0b7bf1dfdb8d0f597b517dc4aa5c5", + "type": "github" + }, + "original": { + "owner": "Supreeeme", + "ref": "v0.4", + "repo": "xwayland-satellite", + "type": "github" + } + }, + "xwayland-satellite-unstable": { + "flake": false, + "locked": { + "lastModified": 1723095288, + "narHash": "sha256-cUlTHg/F0tUpjS/uAIYKwrIRaKwuzdyFo3IiST6E7Fc=", + "owner": "Supreeeme", + "repo": "xwayland-satellite", + "rev": "95afa163a60167cd97bf6afa870bc117a1be3d03", + "type": "github" + }, + "original": { + "owner": "Supreeeme", + "repo": "xwayland-satellite", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index e38c403..2f4da0f 100644 --- a/flake.nix +++ b/flake.nix @@ -7,6 +7,7 @@ home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; sops-nix = { url = "github:mic92/sops-nix"; inputs.nixpkgs.follows = "nixpkgs"; }; dunst-theme = { url = "github:d2718nis/rose-pine-dunst"; flake = false; }; + niri = { url = "github:sodiboo/niri-flake"; inputs.nixpkgs.follows = "nixpkgs"; }; repo-clone.url = "git+https://git.zynh.me/Zynh0722/repo-clone"; fish_theme = { url = "git+https://git.zynh.me/Zynh0722/omf-theme"; flake = false; }; diff --git a/modules/niri.nix b/modules/niri.nix new file mode 100644 index 0000000..3b07194 --- /dev/null +++ b/modules/niri.nix @@ -0,0 +1,16 @@ +{ config, lib, ... }: + +let + inherit (lib) mkIf mkEnableOption; + + cfg = config.snowhawk.niri; +in +{ + options.snowhawk.niri = { + enable = mkEnableOption "niri nixos module"; + }; + + config = mkIf cfg.enable { + programs.niri.enable = false; + }; +}