Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 37 additions & 37 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions nix/flake/per-system/args/default.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
{
lib,
...
}:

let
inherit (lib.my)
collectImports
;
in
{
imports = [
./lib.nix
./pkgs.nix
];
imports = collectImports ./.;
}
14 changes: 7 additions & 7 deletions nix/flake/per-system/default.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
lib,
...
}:

let
inherit (lib.my)
collectImports
;
in
{
imports = [
./apps
./args
./checks
./dev-shells.nix
./pre-commit.nix
];
imports = collectImports ./.;
}
12 changes: 7 additions & 5 deletions nix/hosts/mephistopheles/boot/default.nix
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
{
lib,
pkgs,
...
}:

let
inherit (lib.my)
collectImports
;
in
{
imports = [
./plymouth.nix
./regdomain.nix
./zswap.nix
];
imports = collectImports ./.;

boot = {
initrd.systemd.enable = true;
Expand Down
28 changes: 7 additions & 21 deletions nix/hosts/mephistopheles/default.nix
Original file line number Diff line number Diff line change
@@ -1,29 +1,15 @@
{
lib,
...
}:

let
inherit (lib.my)
collectImports
;
in
{
imports = [
./android.nix
./bluetooth.nix
./boot
./disk-config.nix
./display-manager.nix
./file-systems.nix
./fonts.nix
./gaming.nix
./gnome.nix
./hardware
./impermanence.nix
./input.nix
./locale.nix
./multimedia.nix
./networking
./nix
./security.nix
./sops.nix
./users.nix
];
imports = collectImports ./.;

services = {
gvfs.enable = true; # required for "Trash"
Expand Down
1 change: 1 addition & 0 deletions nix/hosts/mephistopheles/hardware/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
{
imports = [
inputs'.nixpkgs.nixosModules.notDetected
inputs'.nixos-hardware.nixosModules.lenovo-thinkpad-e14-intel-gen7
];

boot.initrd.availableKernelModules = [
Expand Down
19 changes: 7 additions & 12 deletions nix/hosts/mephistopheles/hardware/default.nix
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
{
config,
inputs',
lib,
userConfig,
...
}:

let
inherit (lib.my)
collectImports
;
in
{
imports = [
./battery.nix
./configuration.nix
./graphics.nix
./keyboard.nix
./monitor.nix
./mouse.nix
./printer.nix
./thunderbolt.nix
inputs'.nixos-hardware.nixosModules.lenovo-thinkpad-e14-intel-gen7
];
imports = collectImports ./.;

# TODO switch to facter after NixOS 26.05
# hardware.facter.reportPath = ./facter.json;
Expand Down
9 changes: 5 additions & 4 deletions nix/hosts/mephistopheles/networking/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ let
optional
;

inherit (lib.my)
collectImports
;

# https://userbase.kde.org/KDEConnect#I_have_two_devices_running_KDE_Connect_on_the_same_network,_but_they_can't_see_each_other
kdeConnectPortRange = {
from = 1714;
Expand All @@ -18,10 +22,7 @@ let
in

{
imports = [
./secure-shell.nix
./synchronization.nix
];
imports = collectImports ./.;

networking = {
hostName = "mephistopheles";
Expand Down
12 changes: 5 additions & 7 deletions nix/hosts/mephistopheles/nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,13 @@ let
imap1
mkForce
;

inherit (lib.my)
collectImports
;
in
{
imports = [
./angrr.nix
./envfs.nix
./nix-ld.nix
./nixos-cli.nix
./nixseparatedebuginfod2.nix
];
imports = collectImports ./.;

nix = {
package = pkgs.unstable.nixVersions.latest;
Expand Down
17 changes: 17 additions & 0 deletions nix/lib/my.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@

let
inherit (builtins)
attrNames
baseNameOf
convertHash
pathExists
readDir
hashString
;

inherit (lib)
filterAttrs
hasSuffix
id
isAttrs
isPath
Expand All @@ -28,6 +32,19 @@ let
INFINITY = 1.0e308 * 2;
in
{
collectImports =
dir:
let
isImportable =
name: type:
if type == "directory" then
pathExists (dir + "/${name}/default.nix")
else
hasSuffix ".nix" name && name != "default.nix";
entries = filterAttrs isImportable (readDir dir);
in
map (name: dir + "/${name}") (attrNames entries);

flakeInputStorePath =
{ narHash, ... }:
let
Expand Down
Loading