idk it's funny

This commit is contained in:
Gerg-L 2024-05-21 17:35:17 -04:00
parent 22de7361dd
commit 4f8c86858a
Signed by: gerg-l
SSH key fingerprint: SHA256:FPYDHIkvMocr4wdmZXpgpJjsb2Tw6rASs2ISPbOb0KI
32 changed files with 127 additions and 79 deletions

View file

@ -1,4 +1,4 @@
_: { _file }:
{ pkgs, config, ... }: { pkgs, config, ... }:
{ {
programs.git = { programs.git = {
@ -30,5 +30,5 @@ _:
commit.gpgsign = true; commit.gpgsign = true;
}; };
}; };
#_file inherit _file;
} }

View file

@ -1,4 +1,8 @@
{ nvim-flake, self, ... }: {
nvim-flake,
self,
_file,
}:
{ pkgs, config, ... }: { pkgs, config, ... }:
{ {
local = { local = {
@ -34,6 +38,7 @@
"amdgpu" "amdgpu"
]; ];
}; };
services.gnome.gnome-keyring.enable = true;
programs.steam.enable = true; programs.steam.enable = true;
@ -179,5 +184,5 @@
}; };
system.stateVersion = "23.05"; system.stateVersion = "23.05";
#_file inherit _file;
} }

View file

@ -1,4 +1,4 @@
_: { _file }:
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
sops.secrets.cloudflare = { }; sops.secrets.cloudflare = { };
@ -84,4 +84,5 @@ _:
func "nix-fu.com" "cc2df9163c3730f58b866409ac5a108c" func "nix-fu.com" "cc2df9163c3730f58b866409ac5a108c"
''; '';
}; };
inherit _file;
} }

View file

@ -1,4 +1,4 @@
_: { _file }:
#{ config, ... }: #{ config, ... }:
{ {
# users.users = { # users.users = {
@ -30,5 +30,5 @@ _:
createDatabase = true; createDatabase = true;
}; };
}; };
#_file inherit _file;
} }

View file

@ -1,4 +1,4 @@
{ self, ... }: { _file, self }:
{ lib, ... }: { lib, ... }:
{ {
# I manually switch this sometimes # I manually switch this sometimes
@ -100,5 +100,5 @@
''; '';
}; };
}; };
#_file inherit _file;
} }

View file

@ -1,4 +1,4 @@
_: { _file }:
{ {
config, config,
lib, lib,
@ -97,4 +97,5 @@ _:
${config.services.nginx.user}.extraGroups = [ "miniflux" ]; ${config.services.nginx.user}.extraGroups = [ "miniflux" ];
}; };
}; };
inherit _file;
} }

View file

@ -1,4 +1,4 @@
_: { _file }:
{ pkgs, config, ... }: { pkgs, config, ... }:
{ {
#sops.secrets.nextcloud.owner = "nextcloud"; #sops.secrets.nextcloud.owner = "nextcloud";
@ -22,5 +22,5 @@ _:
default_phone_region = "US"; default_phone_region = "US";
}; };
}; };
#_file inherit _file;
} }

View file

@ -1,4 +1,4 @@
_: { _file }:
{ config, lib, ... }: { config, lib, ... }:
{ {
sops.secrets = sops.secrets =
@ -65,5 +65,5 @@ _:
80 80
443 443
]; ];
#_file inherit _file;
} }

View file

@ -1,4 +1,4 @@
_: { _file }:
{ {
pkgs, pkgs,
config, config,
@ -22,5 +22,5 @@ _:
RestartSec = "30s"; RestartSec = "30s";
}; };
}; };
#_file inherit _file;
} }

View file

@ -1,4 +1,4 @@
_: { _file }:
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
services.postgresql = { services.postgresql = {
@ -19,5 +19,5 @@ _:
settings.unix_socket_permissions = "0770"; settings.unix_socket_permissions = "0770";
}; };
#_file inherit _file;
} }

View file

@ -1,4 +1,4 @@
_: { _file }:
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
sops.secrets.searxngenv = { }; sops.secrets.searxngenv = { };
@ -36,5 +36,5 @@ _:
ui.theme_args.simple_style = "dark"; ui.theme_args.simple_style = "dark";
}; };
}; };
#_file inherit _file;
} }

View file

@ -1,4 +1,4 @@
{ spicetify-nix, ... }: { spicetify-nix, _file }:
let let
spicePkgs = spicetify-nix.legacyPackages; spicePkgs = spicetify-nix.legacyPackages;
in in
@ -7,7 +7,9 @@ in
local.allowedUnfree = [ "spotify" ]; local.allowedUnfree = [ "spotify" ];
programs.spicetify = { programs.spicetify = {
enable = true; enable = true;
enabledCustomApps = builtins.attrValues { inherit (spicePkgs.apps) lyricsPlus; }; enabledCustomApps = builtins.attrValues {
inherit (spicePkgs.apps) lyricsPlus ncsVisualizer marketplace;
};
enabledExtensions = builtins.attrValues { enabledExtensions = builtins.attrValues {
inherit (spicePkgs.extensions) inherit (spicePkgs.extensions)
adblock adblock
@ -37,5 +39,5 @@ in
misc = "282a36"; misc = "282a36";
}; };
}; };
#_file inherit _file;
} }

View file

@ -1,4 +1,4 @@
{ self, ... }: { _dir, _file }:
{ {
pkgs, pkgs,
lib, lib,
@ -27,8 +27,8 @@ let
in in
{ {
environment.etc = { environment.etc = {
"Xorg/1_mon.conf".source = "${self}/hosts/gerg-desktop/1_mon.conf"; "Xorg/1_mon.conf".source = "${_dir}/1_mon.conf";
"Xorg/2_mon.conf".source = "${self}/hosts/gerg-desktop/2_mon.conf"; "Xorg/2_mon.conf".source = "${_dir}/2_mon.conf";
}; };
services.xserver = { services.xserver = {
@ -45,7 +45,7 @@ in
"L /etc/X11/xorg.conf.d/99-custom.conf - - - - /etc/Xorg/2_mon.conf" "L /etc/X11/xorg.conf.d/99-custom.conf - - - - /etc/Xorg/2_mon.conf"
# Everything from here down is almost sane # Everything from here down is almost sane
"L+ /var/lib/libvirt/qemu/Windows.xml - - - - ${self}/hosts/gerg-desktop/Windows.xml" "L+ /var/lib/libvirt/qemu/Windows.xml - - - - ${_dir}/Windows.xml"
]; ];
boot = { boot = {
@ -182,5 +182,5 @@ in
); );
}; };
#_file inherit _file;
} }

View file

@ -1,4 +1,4 @@
{ lanzaboote, ... }: { lanzaboote, _file }:
{ {
config, config,
lib, lib,
@ -91,5 +91,5 @@
efi.efiSysMountPoint = "/efi"; efi.efiSysMountPoint = "/efi";
}; };
}; };
#_file inherit _file;
} }

View file

@ -1,4 +1,8 @@
{ disko, nixos-generators, ... }: {
disko,
nixos-generators,
_file,
}:
{ {
lib, lib,
modulesPath, modulesPath,
@ -39,5 +43,5 @@
edition = lib.mkForce "gerg-minimal"; edition = lib.mkForce "gerg-minimal";
isoName = lib.mkForce "NixOS"; isoName = lib.mkForce "NixOS";
}; };
#_file inherit _file;
} }

View file

@ -1,4 +1,4 @@
_: { _file }:
{ {
lib, lib,
pkgs, pkgs,
@ -84,5 +84,5 @@ _:
size = 8 * 1024; size = 8 * 1024;
} }
]; ];
#_file inherit _file;
} }

View file

@ -34,14 +34,6 @@ rec {
(builtins.filter (lib.hasSuffix ".nix")) (builtins.filter (lib.hasSuffix ".nix"))
]; ];
fixModuleSystem =
file:
lib.pipe file [
builtins.readFile
(builtins.replaceStrings [ "#_file" ] [ "_file = \"${file}\";" ])
(builtins.toFile (builtins.baseNameOf file))
];
mkModules = mkModules =
path: path:
lib.pipe path [ lib.pipe path [
@ -51,7 +43,7 @@ rec {
(lib.removeSuffix ".nix") (lib.removeSuffix ".nix")
(lib.removePrefix "${path}/") (lib.removePrefix "${path}/")
]; ];
value = fixModuleSystem name; value = name;
})) }))
builtins.listToAttrs builtins.listToAttrs
]; ];
@ -83,11 +75,42 @@ rec {
modules = modules =
let let
importWithInputs' = map (x: import x (constructInputs' system inputs)); importWithArgs = map (
x:
let
allArgs = (constructInputs' system inputs) // {
inherit inputs;
_dir =
let
dir = builtins.dirOf x;
in
if (dir != builtins.storeDir) then dir else null;
_file = x;
};
imported = import x;
in
lib.pipe imported [
lib.functionArgs
builtins.attrNames
(map (
x:
if allArgs ? ${x} then
{
name = x;
value = allArgs.${x};
}
else
null
))
(builtins.filter builtins.isAttrs)
builtins.listToAttrs
imported
]
);
in in
builtins.concatLists [ builtins.concatLists [
(importWithInputs' (builtins.attrValues self.nixosModules)) (importWithArgs (builtins.attrValues self.nixosModules))
(importWithInputs' (map fixModuleSystem (listNixFilesRecursive "${self}/hosts/${hostName}"))) (importWithArgs (listNixFilesRecursive "${self}/hosts/${hostName}"))
(import "${unstable}/nixos/modules/module-list.nix") (import "${unstable}/nixos/modules/module-list.nix")
(lib.singleton { (lib.singleton {
networking = { networking = {

View file

@ -1,4 +1,8 @@
{ suckless, self, ... }: {
suckless,
self,
_file,
}:
{ {
pkgs, pkgs,
config, config,
@ -121,5 +125,5 @@
}; };
}; };
}; };
#_file inherit _file;
} }

View file

@ -1,4 +1,4 @@
_: { _file }:
{ {
config, config,
lib, lib,
@ -50,5 +50,5 @@ _:
}; };
}; };
}; };
#_file inherit _file;
} }

View file

@ -1,4 +1,4 @@
_: { _file }:
{ {
config, config,
lib, lib,
@ -21,5 +21,5 @@ _:
displayManager.defaultSession = "xfce"; displayManager.defaultSession = "xfce";
}; };
}; };
#_file inherit _file;
} }

View file

@ -1,4 +1,4 @@
_: { _file }:
{ config, lib, ... }: { config, lib, ... }:
{ {
options.local.DM = { options.local.DM = {
@ -17,5 +17,5 @@ _:
}; };
}; };
}; };
#_file inherit _file;
} }

View file

@ -1,4 +1,4 @@
{ self, ... }: { self, _file }:
{ config, lib, ... }: { config, lib, ... }:
{ {
options.local.DM.lightdm.enable = lib.mkEnableOption ""; options.local.DM.lightdm.enable = lib.mkEnableOption "";
@ -41,5 +41,5 @@
}; };
}; };
}; };
#_file inherit _file;
} }

View file

@ -1,4 +1,4 @@
_: { _file }:
{ pkgs, lib, ... }: { pkgs, lib, ... }:
{ {
services.xserver = { services.xserver = {
@ -9,5 +9,5 @@ _:
excludePackages = [ pkgs.xterm ]; excludePackages = [ pkgs.xterm ];
desktopManager.xterm.enable = false; desktopManager.xterm.enable = false;
}; };
#_file inherit _file;
} }

View file

@ -1,4 +1,4 @@
{ self, ... }: { self, _file }:
{ {
lib, lib,
pkgs, pkgs,
@ -68,5 +68,5 @@
''; '';
}; };
}; };
#_file inherit _file;
} }

View file

@ -1,4 +1,4 @@
_: { _file }:
{ config, lib, ... }: { config, lib, ... }:
{ {
options.local.remoteBuild = { options.local.remoteBuild = {
@ -97,5 +97,5 @@ _:
} }
) )
]; ];
#_file inherit _file;
} }

View file

@ -1,4 +1,4 @@
_: { _file }:
{ config, lib, ... }: { config, lib, ... }:
let let
cfg = config.local.hardware; cfg = config.local.hardware;
@ -41,5 +41,5 @@ in
}; };
} }
]; ];
#_file inherit _file;
} }

View file

@ -1,4 +1,4 @@
_: { _file }:
{ lib, ... }: { lib, ... }:
{ {
options.local.keys = lib.mkOption { }; options.local.keys = lib.mkOption { };
@ -12,5 +12,5 @@ _:
gerg-desktop_fingerprint = "BQxvBOWsTw1gdNDR0KzrSRmbVhDrJdG05vYXkVmw8yA"; gerg-desktop_fingerprint = "BQxvBOWsTw1gdNDR0KzrSRmbVhDrJdG05vYXkVmw8yA";
gerg_gerg-desktop = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJWbwkFJmRBgyWyWU+w3ksZ+KuFw9uXJN3PwqqE7Z/i8"; gerg_gerg-desktop = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJWbwkFJmRBgyWyWU+w3ksZ+KuFw9uXJN3PwqqE7Z/i8";
}; };
#_file inherit _file;
} }

View file

@ -1,4 +1,4 @@
_: { _file }:
{ {
lib, lib,
config, config,
@ -68,5 +68,5 @@ _:
# Useless with flakes (without configuring) # Useless with flakes (without configuring)
programs.command-not-found.enable = false; programs.command-not-found.enable = false;
}; };
#_file inherit _file;
} }

View file

@ -1,4 +1,8 @@
inputs': {
nix,
inputs,
_file,
}:
{ {
lib, lib,
config, config,
@ -9,10 +13,10 @@ inputs':
# #
# Flake registry and $NIX_PATH pinning # Flake registry and $NIX_PATH pinning
# #
nix.registry = lib.pipe inputs' [ nix.registry = lib.pipe inputs [
(lib.filterAttrs (_: lib.isType "flake")) (lib.filterAttrs (_: lib.isType "flake"))
(lib.mapAttrs (_: flake: { inherit flake; })) (lib.mapAttrs (_: flake: { inherit flake; }))
(x: x // { nixpkgs.flake = inputs'.unstable; }) (x: x // { nixpkgs.flake = inputs.unstable; })
]; ];
environment.etc = lib.mapAttrs' (name: value: { environment.etc = lib.mapAttrs' (name: value: {
@ -27,7 +31,7 @@ inputs':
# #
# Use nix directly from master # Use nix directly from master
# #
nix.package = inputs'.nix.packages.default.overrideAttrs (old: { nix.package = nix.packages.default.overrideAttrs (old: {
patches = old.patches or [ ] ++ [ patches = old.patches or [ ] ++ [
(pkgs.fetchpatch { (pkgs.fetchpatch {
url = "https://github.com/NixOS/nix/commit/b6ae3be9c6ec4e9de55479188e76fc330b2304dd.patch"; url = "https://github.com/NixOS/nix/commit/b6ae3be9c6ec4e9de55479188e76fc330b2304dd.patch";
@ -69,5 +73,5 @@ inputs':
# #
reject-flake-config = true; reject-flake-config = true;
}; };
#_file inherit _file;
} }

View file

@ -1,4 +1,4 @@
{ fetch-rs, ... }: { fetch-rs, _file }:
{ {
pkgs, pkgs,
config, config,
@ -160,5 +160,5 @@
}; };
}; };
}; };
#_file inherit _file;
} }

View file

@ -1,4 +1,8 @@
{ sops-nix, self, ... }: {
sops-nix,
self,
_file,
}:
{ {
pkgs, pkgs,
config, config,
@ -15,5 +19,5 @@
age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
}; };
}; };
#_file inherit _file;
} }

View file

@ -1,4 +1,4 @@
_: { _file }:
{ {
pkgs, pkgs,
config, config,
@ -98,5 +98,5 @@ in
}; };
}) })
]; ];
#_file inherit _file;
} }