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, ... }:
{
programs.git = {
@ -30,5 +30,5 @@ _:
commit.gpgsign = true;
};
};
#_file
inherit _file;
}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,4 +1,4 @@
{ self, ... }:
{ _dir, _file }:
{
pkgs,
lib,
@ -27,8 +27,8 @@ let
in
{
environment.etc = {
"Xorg/1_mon.conf".source = "${self}/hosts/gerg-desktop/1_mon.conf";
"Xorg/2_mon.conf".source = "${self}/hosts/gerg-desktop/2_mon.conf";
"Xorg/1_mon.conf".source = "${_dir}/1_mon.conf";
"Xorg/2_mon.conf".source = "${_dir}/2_mon.conf";
};
services.xserver = {
@ -45,7 +45,7 @@ in
"L /etc/X11/xorg.conf.d/99-custom.conf - - - - /etc/Xorg/2_mon.conf"
# 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 = {
@ -182,5 +182,5 @@ in
);
};
#_file
inherit _file;
}

View file

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

View file

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

View file

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

View file

@ -34,14 +34,6 @@ rec {
(builtins.filter (lib.hasSuffix ".nix"))
];
fixModuleSystem =
file:
lib.pipe file [
builtins.readFile
(builtins.replaceStrings [ "#_file" ] [ "_file = \"${file}\";" ])
(builtins.toFile (builtins.baseNameOf file))
];
mkModules =
path:
lib.pipe path [
@ -51,7 +43,7 @@ rec {
(lib.removeSuffix ".nix")
(lib.removePrefix "${path}/")
];
value = fixModuleSystem name;
value = name;
}))
builtins.listToAttrs
];
@ -83,11 +75,42 @@ rec {
modules =
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
builtins.concatLists [
(importWithInputs' (builtins.attrValues self.nixosModules))
(importWithInputs' (map fixModuleSystem (listNixFilesRecursive "${self}/hosts/${hostName}")))
(importWithArgs (builtins.attrValues self.nixosModules))
(importWithArgs (listNixFilesRecursive "${self}/hosts/${hostName}"))
(import "${unstable}/nixos/modules/module-list.nix")
(lib.singleton {
networking = {

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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