diff --git a/flake.nix b/flake.nix index bbf8911..d4f1966 100644 --- a/flake.nix +++ b/flake.nix @@ -1,11 +1,19 @@ { inputs = { nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; - home-manager.url = "github:nix-community/home-manager"; - spicetify-nix.url = "github:the-argus/spicetify-nix"; - suckless.url = "github:ISnortPennies/suckless"; + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + spicetify-nix = { + url = "github:the-argus/spicetify-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + suckless = { + url = "github:ISnortPennies/suckless"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; - outputs = { self, nixpkgs, @@ -51,17 +59,23 @@ ./systems/desktop.nix { environment.etc = { - "nix/inputs/nixpkgs".source = inputs.nixpkgs.outPath; - "nix/inputs/home-manager".source = inputs.home-manager.outPath; + "nix/flake-channels/system".source = inputs.self; + "nix/flake-channels/nixpkgs".source = inputs.nixpkgs.outPath; + "nix/flake-channels/home-manager".source = inputs.home-manager.outPath; }; nix = { nixPath = [ - "nixpkgs=/etc/nix/inputs/nixpkgs" - "home-manager=/etc/nix/inputs/home-manager" + "repl=/etc/nix/flake-channels/system/repl.nix" + "nixpkgs=/etc/nix/flake-channels/nixpkgs" + "home-manager=/etc/nix/flake-channels/home-manager" ]; #automatically get registry from input flakes registry = - lib.attrsets.mapAttrs ( + { + system.flake = self; + default.flake = nixpkgs; + } + // lib.attrsets.mapAttrs ( _: source: { flake = source; } diff --git a/home-manager/home.nix b/home-manager/home.nix index 53329ba..1628595 100644 --- a/home-manager/home.nix +++ b/home-manager/home.nix @@ -1,16 +1,25 @@ { pkgs, settings, + lib, ... }: { - imports = [ - ./librewolf.nix - ./sxhkd.nix - ./theme.nix - ./picom.nix - ./spicetify.nix - ./neovim - ]; + imports = let + modules = [ + "librewolf" + "sxhkd" + "theme" + "picom" + "spicetify" + ]; + in + lib.lists.forEach modules ( + m: + ./. + ("/" + m + ".nix") + ) + ++ [ + ./neovim + ]; xsession.numlock.enable = true; home = { homeDirectory = "/home/${settings.username}"; diff --git a/home-manager/neovim/default.nix b/home-manager/neovim/default.nix index 6c49c9a..e66e707 100644 --- a/home-manager/neovim/default.nix +++ b/home-manager/neovim/default.nix @@ -5,8 +5,8 @@ src = pkgs.fetchFromGitHub { owner = "bluz71"; repo = "vim-moonfly-colors"; - rev = "065c99b95355b33dfaa05bde11ad758e519b04a3"; - sha256 = "sha256-TEYN8G/VNxitpPJPM7+O9AGLm6V7bPkiTlFG5op55pI="; + rev = "ae3db6fe9a6d8ee6b22e28a19754a721d777df44"; + sha256 = "sha256-2EUkTrPVERGmyWfq1a41xYCNHjFVUSrPUsYkWY9Igyc="; }; }; in { diff --git a/home-manager/root.nix b/home-manager/root.nix index 64fd257..c48f821 100644 --- a/home-manager/root.nix +++ b/home-manager/root.nix @@ -1,8 +1,20 @@ -{settings, ...}: { - imports = [ - ./theme.nix - ./neovim - ]; +{ + settings, + lib, + ... +}: { + imports = let + modules = [ + "theme" + ]; + in + lib.lists.forEach modules ( + m: + ./. + ("/" + m + ".nix") + ) + ++ [ + ./neovim + ]; home = { username = "root"; homeDirectory = "/root"; diff --git a/systems/desktop.nix b/systems/desktop.nix index 7c5f526..7ba0e28 100644 --- a/systems/desktop.nix +++ b/systems/desktop.nix @@ -1,26 +1,31 @@ { pkgs, settings, + lib, ... }: { - #important stuff first - imports = [ - ../modules/packages.nix - ../modules/boot.nix - ../modules/fonts.nix - ../modules/scripts.nix - ../modules/vfio.nix - ../modules/refreshrate.nix - ../modules/xserver.nix - ../modules/zsh.nix - ../modules/git.nix - #../modules/mining.nix - ../modules/parrot.nix - ]; + imports = let + modules = [ + "boot" + "fonts" + "git" + #"mining" + "packages" + "parrot" + "refreshrate" + "scripts" + "vfio" + "xserver" + "zsh" + ]; + in + lib.lists.forEach modules ( + m: + ../modules + ("/" + m + ".nix") + ); networking.hostName = "gerg-desktop"; boot.kernelPackages = pkgs.linuxPackages_latest; hardware.cpu.amd.updateMicrocode = true; - #end important stuff environment.systemPackages = with pkgs; [ vscodium gimp diff --git a/systems/laptop.nix b/systems/laptop.nix index a4f7d98..e1d9111 100644 --- a/systems/laptop.nix +++ b/systems/laptop.nix @@ -1,24 +1,29 @@ { pkgs, settings, + lib, ... }: { - #important stuff first - imports = [ - ../modules/boot.nix - ../modules/fonts.nix - ../modules/git.nix - ../modules/packages.nix - ../modules/prime.nix - ../modules/scripts.nix - ../modules/xserver.nix - ../modules/zsh.nix - ]; + imports = let + modules = [ + "boot" + "fonts" + "git" + "packages" + "prime" + "scripts" + "xserver" + "zsh" + ]; + in + lib.lists.forEach modules ( + m: + ../modules + ("/" + m + ".nix") + ); networking.hostName = "gerg-laptop"; boot.kernelPackages = pkgs.linuxPackages_latest; hardware.cpu.amd.updateMicrocode = true; - # end important stuff #environment.systemPackages = with pkgs; [ # xorg.xf86videoamdgpu #];