flake: employ pipes!

This commit is contained in:
Bloxx12 2025-06-04 08:27:12 +02:00
commit 41b72ce92c
Signed by: faukah
SSH key fingerprint: SHA256:Uj2AXqvtdCA4hn5Hq0ZonhIAyUqI1q4w2sMG3Z1TH7E
3 changed files with 19 additions and 16 deletions

View file

@ -31,7 +31,7 @@ inputs: let
networking.hostName = hostname; networking.hostName = hostname;
nixpkgs.hostPlatform = system; nixpkgs.hostPlatform = system;
}) })
(flatten ( (
concatLists [ concatLists [
# configuration for the host, passed as an argument. # configuration for the host, passed as an argument.
(singleton ./${hostname}/default.nix) (singleton ./${hostname}/default.nix)
@ -39,12 +39,12 @@ inputs: let
(singleton ./common.nix) (singleton ./common.nix)
# Import all files called module.nix from my modules directory. # Import all files called module.nix from my modules directory.
( (
filter (hasSuffix "module.nix") (
map toString (listFilesRecursive ../modules) map toString (listFilesRecursive ../modules)
) |> filter (hasSuffix "module.nix")
) )
] ]
)) |> flatten
)
]; ];
}; };
in { in {
@ -61,8 +61,8 @@ in {
system = "aarch64-linux"; system = "aarch64-linux";
hostname = "tower"; hostname = "tower";
}; };
world = mkSystem { # world = mkSystem {
system = "x86_64-linux"; # system = "x86_64-linux";
hostname = "world"; # hostname = "world";
}; # };
} }

View file

@ -16,10 +16,8 @@ in {
# To be able to use this for a varying amount of monitors we do some nasty trickery. # To be able to use this for a varying amount of monitors we do some nasty trickery.
# This was inspired by jacekpoz, whose configuration is linked in this project's README.md. # This was inspired by jacekpoz, whose configuration is linked in this project's README.md.
workspace = workspace =
# We're creating several lists of workspace assignments, one for each monitor, (
# and have to merge them into one big list. # We use imap0 insted of map because imap0 starts indexing at zero as oppsed to one with map.
(flatten
# We then use imap0 insted of map because imap0 starts indexing at zero as oppsed to one with map.
(imap0 (monitorIndex: monitorName: ( (imap0 (monitorIndex: monitorName: (
map ( map (
i: let i: let
@ -35,7 +33,11 @@ in {
(genList (i: i + 1 + (10 * monitorIndex)) 10) (genList (i: i + 1 + (10 * monitorIndex)) 10)
)) ))
# our attrSet of different monitors # our attrSet of different monitors
(attrNames monitors))) (attrNames monitors))
# We're creating several lists of workspace assignments, one for each monitor,
# and have to merge them into one big list.
|> flatten
)
# These are my two special workspaces # These are my two special workspaces
++ [ ++ [
"special:nixos, decorate:false" "special:nixos, decorate:false"

View file

@ -7,8 +7,9 @@
fishinit = import ./fishinit.nix {inherit pkgs aliasesStr;}; fishinit = import ./fishinit.nix {inherit pkgs aliasesStr;};
aliasesStr = aliasesStr =
pkgs.lib.concatStringsSep "\n" mapAttrsToList (k: v: "alias ${k}=\"${v}\"") aliases
(pkgs.lib.mapAttrsToList (k: v: "alias ${k}=\"${v}\"") aliases); |> concatStringsSep "\n";
packages = import ./packages.nix pkgs; packages = import ./packages.nix pkgs;
# this was taken from viperml, check out his config for this! # this was taken from viperml, check out his config for this!