diff --git a/modules/components/window-managers/biri.nix b/modules/components/window-managers/biri.nix new file mode 100644 index 0000000..3aa2489 --- /dev/null +++ b/modules/components/window-managers/biri.nix @@ -0,0 +1,40 @@ +{ inputs, self, ... }: { + flake.nixosModules.graphics = { config, pkgs, lib, ... }: { + config = lib.mkIf (builtins.elem "biri" config.components.windowManagers) { + environment.systemPackages = with pkgs; [ + xdg-desktop-portal-gnome + wl-clipboard + libsecret + cage + wev + qalculate-qt + ]; + + features.applications.gui.nautilus.enable = true; + + services.upower.enable = true; + + services.udisks2.enable = true; + + programs.niri = { + enable = true; + useNautilus = true; + # override niri source to use https://github.com/barrulus/biri + package = self.packages.${pkgs.stdenv.hostPlatform.system}.biri; + }; + + home-manager.users.${config.info.userName} = lib.mkIf (config.features.nixos.home-manager.enable) { + components.windowManagers = [ "niri" ]; + }; + }; + }; + + flake.homeModules.graphics = { config, pkgs, lib, inputs, ... }: { + home = lib.mkIf ((config.components.windowManagers == "biri")||(builtins.elem "biri" config.components.windowManagers)) { + activation.linkNiriConfig = lib.hm.dag.entryAfter ["writeBoundary"] (inputs.helpers.mkSymlinkActivationScript { + target = "${config.xdg.configHome}/niri/config.kdl"; + source = "${config.info.rootPath}/dotfiles/${config.info.hostName}/niri.kdl"; + }); + }; + }; +} \ No newline at end of file diff --git a/modules/components/window-managers/niri.nix b/modules/components/window-managers/niri.nix index 171170e..8366b63 100644 --- a/modules/components/window-managers/niri.nix +++ b/modules/components/window-managers/niri.nix @@ -1,6 +1,6 @@ { inputs, self, ... }: { flake.nixosModules.graphics = { config, pkgs, lib, ... }: { - config = lib.mkIf ((config.components.windowManagers == "niri")||(builtins.elem "niri" config.components.windowManagers)) { + config = lib.mkIf (builtins.elem "niri" config.components.windowManagers) { environment.systemPackages = with pkgs; [ xdg-desktop-portal-gnome wl-clipboard diff --git a/modules/global/home.nix b/modules/global/home.nix index 0490f63..4856022 100644 --- a/modules/global/home.nix +++ b/modules/global/home.nix @@ -31,6 +31,19 @@ file = inputs.helpers.localBinFromStringAttrs config.features.applications.shellScripts; }; + programs.sftpman = lib.mkIf (config.info.hostName != "sakamoto") { + enable = true; + mounts = { + sakamoto = { + host = "sakamoto"; + mountDestPath = "/home/grey/mounts/ssh/sakamoto"; + mountPoint = "/"; + sshKey = "/home/grey/.ssh/id_sakamoto"; + user = "grey"; + }; + }; + }; + targets.genericLinux.enable = config.info.isStandalone; xdg = { diff --git a/modules/hosts/kitagawa/kitagawa.nix b/modules/hosts/kitagawa/kitagawa.nix index fbf7bd2..8e52ce0 100644 --- a/modules/hosts/kitagawa/kitagawa.nix +++ b/modules/hosts/kitagawa/kitagawa.nix @@ -16,8 +16,8 @@ components = { bootLoader.selection = "limine"; displayManager = "ly"; - windowManagers = "niri"; - shells = "noctalia"; + windowManagers = [ "biri" ]; + shells = [ "noctalia" ]; }; features = { @@ -53,6 +53,8 @@ }; }; + stylix.targets.nixos-icons.enable = false; + nix.buildMachines = [ { hostName = "nixremote"; @@ -107,6 +109,7 @@ kdePackages.filelight kdePackages.kate loupe + sshfs ]; }; }; @@ -118,6 +121,19 @@ ]; */ + programs.sftpman = { + enable = true; + mounts = { + takamaki = { + host = "takamaki"; + mountDestPath = "/home/grey/mounts/ssh/takamaki"; + mountPoint = "/"; + sshKey = "/home/grey/.ssh/id_takamaki"; + user = "grey"; + }; + }; + }; + services.udiskie = { enable = true; settings = { diff --git a/modules/hosts/takamaki/takamaki.nix b/modules/hosts/takamaki/takamaki.nix index 528361a..bb2354f 100644 --- a/modules/hosts/takamaki/takamaki.nix +++ b/modules/hosts/takamaki/takamaki.nix @@ -23,19 +23,6 @@ stateVersion = "26.11"; }; - programs.sftpman = { - enable = true; - mounts = { - sakamoto = { - host = "sakamoto"; - mountDestPath = "/home/grey/mounts/ssh/sakamoto"; - mountPoint = "/"; - sshKey = "/home/grey/.ssh/id_sakamoto"; - user = "grey"; - }; - }; - }; - services.gpg-agent = { enable = true; extraConfig = '' diff --git a/modules/options/graphics.nix b/modules/options/graphics.nix index d4788c3..1b5964c 100644 --- a/modules/options/graphics.nix +++ b/modules/options/graphics.nix @@ -3,14 +3,14 @@ options = { components = { windowManagers = lib.mkOption { - type = inputs.helpers.mkOptionalListOfType (inputs.helpers.mkEnumFromDirContents "${self}/modules/components/window-managers"); - description = "Defines the window manager(s) that should be installed, enabling any config associated with them in the process. It can be either a list or just one value."; + type = lib.types.listOf (inputs.helpers.mkEnumFromDirContents "${self}/modules/components/window-managers"); + description = "Defines the window managers that should be installed, enabling any config associated with them in the process."; default = []; }; shells = lib.mkOption { - type = inputs.helpers.mkOptionalListOfType (inputs.helpers.mkEnumFromDirContents "${self}/modules/components/shells"); - description = "Defines the graphical shell(s) that should be installed (e.g. Noctalia, DMS), enabling any config associated with them in the process. It can be either a list or just one value."; + type = lib.types.listOf (inputs.helpers.mkEnumFromDirContents "${self}/modules/components/shells"); + description = "Defines the graphical shells that should be installed (e.g. Noctalia, DMS), enabling any config associated with them in the process."; default = []; }; }; diff --git a/modules/packages/biri.nix b/modules/packages/biri.nix index 82d1929..cd062c0 100644 --- a/modules/packages/biri.nix +++ b/modules/packages/biri.nix @@ -1,40 +1,35 @@ { inputs, self, ... }: { perSystem = { pkgs, ... }: { packages = let - finalAttrs = rec { - name = "${pname}-${version}"; + overrideAttrs = with pkgs; finalAttrs: prevAttrs: { + name = "${finalAttrs.pname}-${finalAttrs.version}"; pname = "biri"; version = "26.04"; src = pkgs.fetchFromGitHub { owner = "barrulus"; - repo = pname; + repo = finalAttrs.pname; rev = "82efb3c0fb688a0c738d15517a2e6a44ed7ca703"; hash = "sha256-Gg4UHnugGnVZifxfKRUnxt3T+DSPgUvHEfE9tflA5zM="; }; cargoHash = "sha256-aNovCzrTtmqTO33YtZap47npdN73zXC1bap5q5dZvZk="; - }; - overrideAttrs = with pkgs; prev: { - rustPlatform = prev.rustPlatform // { - buildRustPackage = args: pkgs.rustPlatform.buildRustPackage (args finalAttrs // finalAttrs); + cargoDeps = rustPlatform.fetchCargoVendor { + inherit (finalAttrs) pname src version; + hash = finalAttrs.cargoHash; }; }; in { - biri = pkgs.niri.override (prev: overrideAttrs prev); + biri = (pkgs.niri.overrideAttrs (final: prev: overrideAttrs final prev)); - biri-unwrapped = pkgs.niri.override (prev: (overrideAttrs prev) // { - rustPlatform = (overrideAttrs prev).rustPlatform // { - buildRustPackage = args: pkgs.rustPlatform.buildRustPackage (args finalAttrs // { - postInstall = '' - install -Dm0644 README.md resources/default-config.kdl -t $doc/share/doc/niri - mv docs/wiki $doc/share/doc/niri/wiki - cp -r . $out - ''; - }); - }; - }); + biri-unwrapped = (pkgs.niri.overrideAttrs (final: prev: (overrideAttrs final prev) // { + postInstall = '' + install -Dm0644 README.md resources/default-config.kdl -t $doc/share/doc/niri + mv docs/wiki $doc/share/doc/niri/wiki + cp -r . $out + ''; + })); }; }; } \ No newline at end of file