diff --git a/checks/default.nix b/checks/default.nix new file mode 100644 index 00000000..1f02b175 --- /dev/null +++ b/checks/default.nix @@ -0,0 +1,7 @@ +{ + pkgs, + self, +}: let + nixosMachines = import ./machines.nix {inherit pkgs self;}; +in + nixosMachines diff --git a/checks/machines.nix b/checks/machines.nix new file mode 100644 index 00000000..9211400b --- /dev/null +++ b/checks/machines.nix @@ -0,0 +1,10 @@ +# CI: https://github.com/Mic92/dotfiles/blob/c2f538934d67417941f83d8bb65b8263c43d32ca/flake.nix#L168 +{ + pkgs, + self, +}: let + inherit (pkgs.lib) filterAttrs mapAttrs' nameValuePair; +in + mapAttrs' + (name: config: nameValuePair "nixos-${name}" config.config.system.build.toplevel) + ((filterAttrs (_: config: config.pkgs.system == pkgs.system)) self.nixosConfigurations) diff --git a/common/home/neovim/langs/markdown.nix b/common/home/neovim/langs/markdown.nix index b104d856..f016f083 100644 --- a/common/home/neovim/langs/markdown.nix +++ b/common/home/neovim/langs/markdown.nix @@ -1,14 +1,15 @@ { config, - pkgs, lib, + pkgs, + self, vimplugin-easytables-src, ... }: let inherit (config.vars) neovimIde; inherit (pkgs) vimPlugins; - inherit (import ../../../../flake/lib.nix {inherit pkgs;}) buildPlugin; + inherit (import "${self}/lib.nix" {inherit pkgs;}) buildPlugin; in lib.mkIf neovimIde { programs = { diff --git a/common/home/neovim/langs/web.nix b/common/home/neovim/langs/web.nix index d983f53e..931327bd 100644 --- a/common/home/neovim/langs/web.nix +++ b/common/home/neovim/langs/web.nix @@ -1,14 +1,15 @@ { config, - pkgs, lib, + pkgs, + self, vimplugin-ts-error-translator-src, ... }: let inherit (config.vars) neovimIde; inherit (pkgs) vimPlugins; - inherit (import ../../../../flake/lib.nix {inherit pkgs;}) buildPlugin; + inherit (import "${self}/lib.nix" {inherit pkgs;}) buildPlugin; in lib.mkIf neovimIde { programs = { diff --git a/devices/servivi/modules/binary-cache.nix b/devices/servivi/modules/binary-cache.nix index 500e0bbf..6afc17f8 100644 --- a/devices/servivi/modules/binary-cache.nix +++ b/devices/servivi/modules/binary-cache.nix @@ -26,6 +26,10 @@ in { nix-fast-buildPkg ]; + home-manager.users.${mainUser}.programs.bash.shellAliases = { + nix-fast-build = "nix-fast-build -f $FLAKE/.#nixFastChecks"; + }; + # Populate cache systemd = { services.buildAll = { @@ -51,7 +55,7 @@ in { fi git clone https://git.nelim.org/matt1432/nixos-configs.git nix-clone cd nix-clone - nix-fast-build + nix-fast-build -f .#nixFastChecks cd .. rm -r nix-clone ''; diff --git a/flake.in.nix b/flake.in.nix index 2bdaff56..49cf57ae 100644 --- a/flake.in.nix +++ b/flake.in.nix @@ -1,6 +1,6 @@ { inputs = let - inherit (import ./flake/inputs.nix) mkDep mkInput otherInputs; + inherit (import ./inputs.nix) mkDep mkInput otherInputs; mainInputs = { nixpkgs = mkInput { @@ -47,7 +47,7 @@ self, ... }: let - inherit (import ./flake/lib.nix inputs) mkVersion mkNixOS mkNixOnDroid mkPkgs; + inherit (import "${self}/lib.nix" inputs) mkVersion mkNixOS mkNixOnDroid mkPkgs; supportedSystems = ["x86_64-linux" "aarch64-linux"]; @@ -154,10 +154,10 @@ }; }); - # For nix-fast-build - checks = + # For nix-fast-build. I use a custom output to alleviate eval time of this flake. ie. when doing nix flake show + nixFastChecks = perSystem (pkgs: - import ./flake/ci.nix {inherit pkgs self;}); + import ./checks {inherit pkgs self;}); formatter = perSystem (pkgs: pkgs.alejandra); }; diff --git a/flake/ci.nix b/flake/ci.nix deleted file mode 100644 index 1506279e..00000000 --- a/flake/ci.nix +++ /dev/null @@ -1,13 +0,0 @@ -# CI: https://github.com/Mic92/dotfiles/blob/c2f538934d67417941f83d8bb65b8263c43d32ca/flake.nix#L168 -{ - pkgs, - self, -}: let - inherit (pkgs.lib) filterAttrs mapAttrs' nameValuePair; - - nixosMachines = - mapAttrs' - (name: config: nameValuePair "nixos-${name}" config.config.system.build.toplevel) - ((filterAttrs (_: config: config.pkgs.system == pkgs.system)) self.nixosConfigurations); -in - nixosMachines diff --git a/homeManagerModules/firefox/default.nix b/homeManagerModules/firefox/default.nix index 753b55ff..39b25883 100644 --- a/homeManagerModules/firefox/default.nix +++ b/homeManagerModules/firefox/default.nix @@ -9,6 +9,7 @@ self: { firefox-gx = pkgs.callPackage ./gx-theme.nix { inherit (self.inputs) firefox-gx-src; + inherit (import "${self}/lib.nix" {}) mkVersion; }; in { config = { diff --git a/homeManagerModules/firefox/gx-theme.nix b/homeManagerModules/firefox/gx-theme.nix index f779c7a5..318d2b01 100644 --- a/homeManagerModules/firefox/gx-theme.nix +++ b/homeManagerModules/firefox/gx-theme.nix @@ -1,28 +1,27 @@ { lib, + mkVersion, firefox-gx-src, stdenvNoCC, -}: let - inherit (import ../../flake/lib.nix {}) mkVersion; -in - stdenvNoCC.mkDerivation { - pname = "firefox-gx"; - version = mkVersion firefox-gx-src; +}: +stdenvNoCC.mkDerivation { + pname = "firefox-gx"; + version = mkVersion firefox-gx-src; - src = firefox-gx-src; + src = firefox-gx-src; - installPhase = '' - # Personal changes - sed -i 's/var(--fuchsia))/var(--purple))/' ./chrome/components/ogx_root-personal.css - sed -i 's#../newtab/wallpaper-dark1.png#../newtab/wallpaper-dark2.png#' ./chrome/components/ogx_root-personal.css + installPhase = '' + # Personal changes + sed -i 's/var(--fuchsia))/var(--purple))/' ./chrome/components/ogx_root-personal.css + sed -i 's#../newtab/wallpaper-dark1.png#../newtab/wallpaper-dark2.png#' ./chrome/components/ogx_root-personal.css - mkdir -p $out - cp -r ./* $out - ''; + mkdir -p $out + cp -r ./* $out + ''; - meta = { - description = "Firefox Theme CSS to Opera GX Lovers"; - homepage = "https://github.com/Godiesc/firefox-gx"; - license = lib.licenses.mspl; - }; - } + meta = { + description = "Firefox Theme CSS to Opera GX Lovers"; + homepage = "https://github.com/Godiesc/firefox-gx"; + license = lib.licenses.mspl; + }; +} diff --git a/flake/inputs.nix b/inputs.nix similarity index 100% rename from flake/inputs.nix rename to inputs.nix diff --git a/flake/lib.nix b/lib.nix similarity index 96% rename from flake/lib.nix rename to lib.nix index b3764d88..1aa1caff 100644 --- a/flake/lib.nix +++ b/lib.nix @@ -39,7 +39,7 @@ modules = [ {home-manager.extraSpecialArgs = specialArgs;} - ../common + ./common ] ++ mods; }; @@ -60,7 +60,7 @@ }; } {home-manager = {inherit extraSpecialArgs;};} - ../common/nix-on-droid.nix + ./common/nix-on-droid.nix ] ++ mods; };