refactor: rename checks and move files out of flake dir
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2024-08-05 16:40:32 -04:00
parent 94bd0d81f5
commit 087dd2af15
11 changed files with 55 additions and 45 deletions

7
checks/default.nix Normal file
View file

@ -0,0 +1,7 @@
{
pkgs,
self,
}: let
nixosMachines = import ./machines.nix {inherit pkgs self;};
in
nixosMachines

10
checks/machines.nix Normal file
View file

@ -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)

View file

@ -1,14 +1,15 @@
{ {
config, config,
pkgs,
lib, lib,
pkgs,
self,
vimplugin-easytables-src, vimplugin-easytables-src,
... ...
}: let }: let
inherit (config.vars) neovimIde; inherit (config.vars) neovimIde;
inherit (pkgs) vimPlugins; inherit (pkgs) vimPlugins;
inherit (import ../../../../flake/lib.nix {inherit pkgs;}) buildPlugin; inherit (import "${self}/lib.nix" {inherit pkgs;}) buildPlugin;
in in
lib.mkIf neovimIde { lib.mkIf neovimIde {
programs = { programs = {

View file

@ -1,14 +1,15 @@
{ {
config, config,
pkgs,
lib, lib,
pkgs,
self,
vimplugin-ts-error-translator-src, vimplugin-ts-error-translator-src,
... ...
}: let }: let
inherit (config.vars) neovimIde; inherit (config.vars) neovimIde;
inherit (pkgs) vimPlugins; inherit (pkgs) vimPlugins;
inherit (import ../../../../flake/lib.nix {inherit pkgs;}) buildPlugin; inherit (import "${self}/lib.nix" {inherit pkgs;}) buildPlugin;
in in
lib.mkIf neovimIde { lib.mkIf neovimIde {
programs = { programs = {

View file

@ -26,6 +26,10 @@ in {
nix-fast-buildPkg nix-fast-buildPkg
]; ];
home-manager.users.${mainUser}.programs.bash.shellAliases = {
nix-fast-build = "nix-fast-build -f $FLAKE/.#nixFastChecks";
};
# Populate cache # Populate cache
systemd = { systemd = {
services.buildAll = { services.buildAll = {
@ -51,7 +55,7 @@ in {
fi fi
git clone https://git.nelim.org/matt1432/nixos-configs.git nix-clone git clone https://git.nelim.org/matt1432/nixos-configs.git nix-clone
cd nix-clone cd nix-clone
nix-fast-build nix-fast-build -f .#nixFastChecks
cd .. cd ..
rm -r nix-clone rm -r nix-clone
''; '';

View file

@ -1,6 +1,6 @@
{ {
inputs = let inputs = let
inherit (import ./flake/inputs.nix) mkDep mkInput otherInputs; inherit (import ./inputs.nix) mkDep mkInput otherInputs;
mainInputs = { mainInputs = {
nixpkgs = mkInput { nixpkgs = mkInput {
@ -47,7 +47,7 @@
self, self,
... ...
}: let }: 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"]; supportedSystems = ["x86_64-linux" "aarch64-linux"];
@ -154,10 +154,10 @@
}; };
}); });
# For nix-fast-build # For nix-fast-build. I use a custom output to alleviate eval time of this flake. ie. when doing nix flake show
checks = nixFastChecks =
perSystem (pkgs: perSystem (pkgs:
import ./flake/ci.nix {inherit pkgs self;}); import ./checks {inherit pkgs self;});
formatter = perSystem (pkgs: pkgs.alejandra); formatter = perSystem (pkgs: pkgs.alejandra);
}; };

View file

@ -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

View file

@ -9,6 +9,7 @@ self: {
firefox-gx = pkgs.callPackage ./gx-theme.nix { firefox-gx = pkgs.callPackage ./gx-theme.nix {
inherit (self.inputs) firefox-gx-src; inherit (self.inputs) firefox-gx-src;
inherit (import "${self}/lib.nix" {}) mkVersion;
}; };
in { in {
config = { config = {

View file

@ -1,10 +1,9 @@
{ {
lib, lib,
mkVersion,
firefox-gx-src, firefox-gx-src,
stdenvNoCC, stdenvNoCC,
}: let }:
inherit (import ../../flake/lib.nix {}) mkVersion;
in
stdenvNoCC.mkDerivation { stdenvNoCC.mkDerivation {
pname = "firefox-gx"; pname = "firefox-gx";
version = mkVersion firefox-gx-src; version = mkVersion firefox-gx-src;

View file

@ -39,7 +39,7 @@
modules = modules =
[ [
{home-manager.extraSpecialArgs = specialArgs;} {home-manager.extraSpecialArgs = specialArgs;}
../common ./common
] ]
++ mods; ++ mods;
}; };
@ -60,7 +60,7 @@
}; };
} }
{home-manager = {inherit extraSpecialArgs;};} {home-manager = {inherit extraSpecialArgs;};}
../common/nix-on-droid.nix ./common/nix-on-droid.nix
] ]
++ mods; ++ mods;
}; };