Skip to content

Commit

Permalink
Merge branch 'da-add-overlays' into da-add-hostname-management
Browse files Browse the repository at this point in the history
  • Loading branch information
David Arnold committed Oct 9, 2020
2 parents d7a9a19 + 4484300 commit 231e120
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 14 deletions.
6 changes: 2 additions & 4 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
{ nixpkgs ? import ./nix/nixpkgs.nix
, system ? builtins.currentSystem
, overlays ? [ ]
}:
import nixpkgs {
inherit system;
overlays = [
(import ./overlay.nix)
(import ./extensions/overlay.nix)
];
overlays = [ (import ./overlay.nix) ] ++ overlays;
}
11 changes: 6 additions & 5 deletions extensions/options.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@ let
'';
};

etcHosts = pkgs.writeText "${name}-etchosts"
(lib.concatStringsSep "\n"
(lib.mapAttrsToList (name: value: value + " " + name) static-dns)
);
etcHosts =
pkgs.writeText "${name}-etchosts"
(
lib.concatStringsSep "\n"
(lib.mapAttrsToList (name: value: value + " " + name) static-dns)
);
# since this temporarily modifies /etc/hosts, use of sudo can't be avoided
fqdnsActivate = {
name = "dns-activate";
Expand Down Expand Up @@ -115,4 +117,3 @@ in
);
};
}

1 change: 0 additions & 1 deletion extensions/overlay.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ final: prev:
{
hostctl = prev.callPackage ./hostctl { };
}

7 changes: 4 additions & 3 deletions mkDevShell/options.nix
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ let

opCat = { name, value }:
let
opCmd = { name, help, ...}:
opCmd = { name, help, ... }:
let
len = maxCommandLength - (builtins.stringLength name);
in
Expand All @@ -57,7 +57,7 @@ let
else
"${pad name len} - ${help}";
in
"\n[${name}]\n" + builtins.concatStringsSep "\n" (map opCmd value);
"\n[${name}]\n" + builtins.concatStringsSep "\n" (map opCmd value);
in
builtins.concatStringsSep "\n" (map opCat commandByCategoriesSorted)
;
Expand Down Expand Up @@ -226,7 +226,8 @@ in
];

packages =
builtins.filter (x: x != null)
builtins.filter
(x: x != null)
(map (x: x.package) config.commands);
};
}
7 changes: 6 additions & 1 deletion shell.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#!/usr/bin/env nix-build
# Used to test the shell
{ pkgs ? import ./. { } }:
{ pkgs ? import ./. {
overlays = [
(import ./extensions/overlay.nix)
];
}
}:
pkgs.mkDevShell {
imports = [
(pkgs.mkDevShell.importTOML ./devshell.toml)
Expand Down

0 comments on commit 231e120

Please sign in to comment.