-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(flake): split flake configuration
Also I cleaned up flake.nix
- Loading branch information
Showing
7 changed files
with
71 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ lib, ... }: | ||
let | ||
inherit (lib.attrsets) nameValuePair; | ||
inherit (lib.my.hosts) mkHost; | ||
inherit (lib.lists) flatten; | ||
|
||
hosts = builtins.attrNames (builtins.readDir ./hosts); | ||
desktopHosts = lib.my.string.mkNixNamesFromDir ./modules/desktop/wm; | ||
|
||
finalHosts = (flatten (builtins.map (x: builtins.map (d: "${x}-${d}") desktopHosts) hosts)) ++ hosts; | ||
|
||
devHosts = builtins.listToAttrs (builtins.map | ||
(n: | ||
let devName = "${n}-dev"; | ||
in | ||
nameValuePair (devName) (mkHost { | ||
name = devName; | ||
isDevMode = true; | ||
})) | ||
finalHosts); | ||
|
||
normalHosts = builtins.listToAttrs (builtins.map | ||
(name: { | ||
inherit name; | ||
value = mkHost { inherit name; }; | ||
}) | ||
finalHosts); | ||
in | ||
normalHosts // devHosts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ inputs, lib, pkgs, ... }: with lib; | ||
with lib.my; let | ||
shellPkgs = import inputs.nixpkgs-unstable { | ||
inherit system; | ||
|
||
config = { | ||
allowUnfree = true; | ||
allowBroken = true; | ||
}; | ||
}; | ||
names = lib.my.string.mkNixNamesFromDir ./shells; | ||
mkShellAttrs = name: { | ||
inherit name; | ||
value = pkgs.callPackage (./shells + "/${name}.nix") { unstable = shellPkgs; }; | ||
}; | ||
in | ||
builtins.listToAttrs (builtins.map mkShellAttrs names) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ lib, ... }: with lib; with lib.my; let | ||
templatesDirs = builtins.attrNames | ||
(lib.filterAttrs (n: v: v == "directory") | ||
(builtins.readDir ./templates)); | ||
|
||
templates = lists.forEach templatesDirs (name: { | ||
inherit name; | ||
|
||
value = { | ||
path = ./templates/${name}; | ||
description = "Template for ${name}"; | ||
}; | ||
}); | ||
in | ||
builtins.listToAttrs templates |