imp: use bud nixos-/devhsllModules and hide rebiding

both modules depend on `self`/`inputs` available as special args for
both, devshell & nixos modules, so bump to an improved `digga`, as well.
This commit is contained in:
David Arnold 2021-07-20 23:36:41 -05:00
parent 0410acf3d7
commit a3ec0d2814
No known key found for this signature in database
GPG Key ID: AB15A6AF1101390D
4 changed files with 76 additions and 71 deletions

View File

@ -46,11 +46,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1626456025, "lastModified": 1626840404,
"narHash": "sha256-TrKfxVir+TilnqSNYokxJKx2ugEem7Khv4YmSwqj9JQ=", "narHash": "sha256-6HKRxPlVO4iKyPNAjkjku3JzGX1lgJ+93ieWAx7MY60=",
"owner": "divnix", "owner": "divnix",
"repo": "bud", "repo": "bud",
"rev": "59c10c3879b11371944ab664462fe2e9366cfb44", "rev": "452ec18574b6e4d8b8a6aae9e190255d4c89768c",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -172,11 +172,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1626836850, "lastModified": 1626841951,
"narHash": "sha256-qMZ4T0ig9bBHsiu1nEnYzI6JjXjpJv2fnBexpJ8cw+0=", "narHash": "sha256-tppFdKz4fvt7gYsMotT/kWSIzKWcdDsMCkQzn6mGRCA=",
"owner": "divnix", "owner": "divnix",
"repo": "digga", "repo": "digga",
"rev": "af700c53c6c955a46ae834c1e6e7c6bb5cb1adeb", "rev": "f676b7899541836129c188f8a23c21f439a02960",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@ -70,9 +70,6 @@
, deploy , deploy
, ... , ...
} @ inputs: } @ inputs:
let
bud' = bud self; # rebind to access self.budModules
in
digga.lib.mkFlake digga.lib.mkFlake
{ {
inherit self inputs; inherit self inputs;
@ -117,7 +114,7 @@
ci-agent.nixosModules.agent-profile ci-agent.nixosModules.agent-profile
home.nixosModules.home-manager home.nixosModules.home-manager
agenix.nixosModules.age agenix.nixosModules.age
(bud.nixosModules.bud bud') bud.nixosModules.bud
]; ];
}; };
@ -150,7 +147,7 @@
}; # digga.lib.importers.rakeLeaves ./users/hm; }; # digga.lib.importers.rakeLeaves ./users/hm;
}; };
devshell.modules = [ (import ./shell bud') ]; devshell = ./shell;
homeConfigurations = digga.lib.mkHomeConfigurations self.nixosConfigurations; homeConfigurations = digga.lib.mkHomeConfigurations self.nixosConfigurations;

View File

@ -1,63 +1,10 @@
bud: { self, inputs, ... }:
{ pkgs, extraModulesPath, ... }:
let
hooks = import ./hooks;
pkgWithCategory = category: package: { inherit package category; };
linter = pkgWithCategory "linter";
docs = pkgWithCategory "docs";
devos = pkgWithCategory "devos";
in
{ {
_file = toString ./.; externalModules = with inputs; [
bud.devshellModules.bud
imports = [ "${extraModulesPath}/git/hooks.nix" ]; ];
git = { inherit hooks; }; modules = [
./devos.nix
# tempfix: remove when merged https://github.com/numtide/devshell/pull/123
devshell.startup.load_profiles = pkgs.lib.mkForce (pkgs.lib.noDepEntry ''
# PATH is devshell's exorbitant privilige:
# fence against its pollution
_PATH=''${PATH}
# Load installed profiles
for file in "$DEVSHELL_DIR/etc/profile.d/"*.sh; do
# If that folder doesn't exist, bash loves to return the whole glob
[[ -f "$file" ]] && source "$file"
done
# Exert exorbitant privilige and leave no trace
export PATH=''${_PATH}
unset _PATH
'');
packages = with pkgs; [
git-crypt
]; ];
commands = with pkgs; [
(devos (bud { inherit pkgs; }))
(devos nixUnstable)
(devos agenix)
{
category = "devos";
name = pkgs.nvfetcher-bin.pname;
help = pkgs.nvfetcher-bin.meta.description;
command = "cd $DEVSHELL_ROOT/pkgs; ${pkgs.nvfetcher-bin}/bin/nvfetcher -c ./sources.toml --no-output $@; nixpkgs-fmt _sources/";
}
(linter nixpkgs-fmt)
(linter editorconfig-checker)
# (docs python3Packages.grip) too many deps
(docs mdbook)
]
++ lib.optional
(pkgs ? deploy-rs)
(devos deploy-rs.deploy-rs)
++ lib.optional
(system != "i686-linux")
(devos cachix)
;
} }

61
shell/devos.nix Normal file
View File

@ -0,0 +1,61 @@
{ pkgs, extraModulesPath, ... }:
let
hooks = import ./hooks;
pkgWithCategory = category: package: { inherit package category; };
linter = pkgWithCategory "linter";
docs = pkgWithCategory "docs";
devos = pkgWithCategory "devos";
in
{
_file = toString ./.;
imports = [ "${extraModulesPath}/git/hooks.nix" ];
git = { inherit hooks; };
# tempfix: remove when merged https://github.com/numtide/devshell/pull/123
devshell.startup.load_profiles = pkgs.lib.mkForce (pkgs.lib.noDepEntry ''
# PATH is devshell's exorbitant privilige:
# fence against its pollution
_PATH=''${PATH}
# Load installed profiles
for file in "$DEVSHELL_DIR/etc/profile.d/"*.sh; do
# If that folder doesn't exist, bash loves to return the whole glob
[[ -f "$file" ]] && source "$file"
done
# Exert exorbitant privilige and leave no trace
export PATH=''${_PATH}
unset _PATH
'');
packages = with pkgs; [
git-crypt
];
commands = with pkgs; [
(devos nixUnstable)
(devos agenix)
{
category = "devos";
name = pkgs.nvfetcher-bin.pname;
help = pkgs.nvfetcher-bin.meta.description;
command = "cd $DEVSHELL_ROOT/pkgs; ${pkgs.nvfetcher-bin}/bin/nvfetcher -c ./sources.toml --no-output $@; nixpkgs-fmt _sources/";
}
(linter nixpkgs-fmt)
(linter editorconfig-checker)
# (docs python3Packages.grip) too many deps
(docs mdbook)
]
++ lib.optional
(pkgs ? deploy-rs)
(devos deploy-rs.deploy-rs)
++ lib.optional
(system != "i686-linux")
(devos cachix)
;
}