systems -> hosts

moved functions to /lib

inputs over imports

turned each module file into a nixosModule

moved registry and $NIX_PATH pinning to /modules/pinning.nix
This commit is contained in:
Gerg-L 2023-06-22 22:55:43 -04:00
parent ee2beea680
commit f43d0b741c
42 changed files with 224 additions and 240 deletions

93
flake.lock generated
View file

@ -7,11 +7,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1687028856, "lastModified": 1687134796,
"narHash": "sha256-vKV3I31tmXwaWHiUOgfDVd27cEHqaPBr1lt9+NKdIp8=", "narHash": "sha256-gjBAkEtNPMQzqK4IHjTQBUv3VhggszOHLJbhXZy0OVQ=",
"owner": "nix-community", "owner": "nix-community",
"repo": "disko", "repo": "disko",
"rev": "64c9c78c15fd4c899d857bf09dba88bda771b43a", "rev": "4823509bb3b014dc85abefc13efcfa076d36338a",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -27,11 +27,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1686447837, "lastModified": 1687390847,
"narHash": "sha256-7MUSWCGDceC5Z7zgt/FlJ1tO7veeY6On8HtYXT2BIlw=", "narHash": "sha256-T75KT5XFPMvmHOdxuoWotI+vCIM2cM5192QxLxenudU=",
"owner": "gerg-L", "owner": "gerg-L",
"repo": "fetch-rs", "repo": "fetch-rs",
"rev": "38af76fe73118eb6317a34511d0a7d4f2f1af409", "rev": "a571c0c6768db9c643cc81735a1a12799d09ed4e",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -56,24 +56,6 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1685518550,
"narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"lowdown-src": { "lowdown-src": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -92,11 +74,11 @@
}, },
"master": { "master": {
"locked": { "locked": {
"lastModified": 1687093833, "lastModified": 1687388587,
"narHash": "sha256-B+cXcBTpc9bsmPd59rKIcFG6hYCGgxbeIxA+OIIFjlU=", "narHash": "sha256-TILQ4Ch+Y9Q6Hczm5vwgGWXD2ow29uxXPJuGzqS6jj0=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "8f83962b34fe83520c0edf6320ebd05b06d4f65b", "rev": "563afe26c68c2323e817345687c367ab5ca06dfa",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -145,11 +127,11 @@
}, },
"nixlib": { "nixlib": {
"locked": { "locked": {
"lastModified": 1685840432, "lastModified": 1687049841,
"narHash": "sha256-VJIbiKsY7Xy4E4WcgwUt/UiwYDmN5BAk8tngAjcWsqY=", "narHash": "sha256-FBNZQfWtA7bb/rwk92mfiWc85x4hXta2OAouDqO5W8w=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixpkgs.lib", "repo": "nixpkgs.lib",
"rev": "961e99baaaa57f5f7042fe7ce089a88786c839f4", "rev": "908af6d1fa3643c5818ea45aa92b21d6385fbbe5",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -166,11 +148,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1686924781, "lastModified": 1687183443,
"narHash": "sha256-6r3Hm2Fxf4F7LIWRYKU9bsS/xJwlG6L2+/I/pdffvOs=", "narHash": "sha256-foX4pkph2AwUdJL3JURa7IHog+YRIheZ54vwHwxqwhU=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixos-generators", "repo": "nixos-generators",
"rev": "a54683aa7eff00ee5b33dec225525d0eb6ab02de", "rev": "09140f23f5ffce828db4ef040070bdd9595b1f3a",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -288,11 +270,11 @@
"nixpkgs-stable": "nixpkgs-stable" "nixpkgs-stable": "nixpkgs-stable"
}, },
"locked": { "locked": {
"lastModified": 1687058111, "lastModified": 1687267549,
"narHash": "sha256-xDSn/APfAdJinHV4reTfplX5XnLsJSGdVwHpmdgP9Mo=", "narHash": "sha256-jpg5zwhEQlovGH/xrml9X5ciPKpIZr/3Z04+Fh3VtQY=",
"owner": "mic92", "owner": "mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "1634d2da53f079e7f5924efa7a96511cd9596f81", "rev": "d299d0538295e71e194aa0dfa896ad399f4508e3",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -303,37 +285,33 @@
}, },
"spicetify-nix": { "spicetify-nix": {
"inputs": { "inputs": {
"flake-utils": "flake-utils",
"nixpkgs": [ "nixpkgs": [
"unstable" "unstable"
] ]
}, },
"locked": { "locked": {
"lastModified": 1686173678, "lastModified": 1687479458,
"narHash": "sha256-aYzl34xb3u9I57sqkvSldQKltCnxhjvvLABjgFRxOVE=", "narHash": "sha256-7ZeYakvK1Raz4oFwGrbcMbDe12nf9TXdXJvgp/e+N8Y=",
"owner": "the-argus", "path": "/home/gerg/Projects/spicetify-nix",
"repo": "spicetify-nix", "type": "path"
"rev": "f024752b691ac2dcb2ad378d72a2e3084ce83b79",
"type": "github"
}, },
"original": { "original": {
"owner": "the-argus", "path": "/home/gerg/Projects/spicetify-nix",
"repo": "spicetify-nix", "type": "path"
"type": "github"
} }
}, },
"stable": { "stable": {
"locked": { "locked": {
"lastModified": 1686929285, "lastModified": 1687379288,
"narHash": "sha256-WGtVzn+vGMPTXDO0DMNKVFtf+zUSqeW+KKk4Y/Ae99I=", "narHash": "sha256-cSuwfiqYfeVyqzCRkU9AvLTysmEuSal8nh6CYr+xWog=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "93fddcf640ceca0be331210ba3101cee9d91c13d", "rev": "ef0bc3976340dab9a4e087a0bcff661a8b2e87f3",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nixos", "owner": "nixos",
"ref": "nixos-22.11", "ref": "nixos-23.05",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
@ -358,21 +336,6 @@
"type": "github" "type": "github"
} }
}, },
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"unstable": { "unstable": {
"locked": { "locked": {
"lastModified": 1686960236, "lastModified": 1686960236,

View file

@ -3,9 +3,9 @@
#channels #channels
master.url = "github:nixos/nixpkgs"; master.url = "github:nixos/nixpkgs";
unstable.url = "github:nixos/nixpkgs/nixos-unstable"; unstable.url = "github:nixos/nixpkgs/nixos-unstable";
stable.url = "github:nixos/nixpkgs/nixos-22.11"; stable.url = "github:nixos/nixpkgs/nixos-23.05";
pipewire_fix.url = "github:nixos/nixpkgs/45a55711fe12d0aada3aa04746082cf1b83dfbf3"; pipewire_fix.url = "github:nixos/nixpkgs/45a55711fe12d0aada3aa04746082cf1b83dfbf3";
#nix 2.16 #nix 2.17
nix.url = "github:nixos/nix/03f9ff6ea59d21c6d7b29c64a03d5041bd621261"; nix.url = "github:nixos/nix/03f9ff6ea59d21c6d7b29c64a03d5041bd621261";
nixos-generators = { nixos-generators = {
@ -20,9 +20,9 @@
url = "github:nix-community/disko"; url = "github:nix-community/disko";
inputs.nixpkgs.follows = "unstable"; inputs.nixpkgs.follows = "unstable";
}; };
#the-argus is awesome
spicetify-nix = { spicetify-nix = {
url = "github:the-argus/spicetify-nix"; #url = "github:the-argus/spicetify-nix";
url = "path:/home/gerg/Projects/spicetify-nix";
inputs.nixpkgs.follows = "unstable"; inputs.nixpkgs.follows = "unstable";
}; };
#my own packages #my own packages
@ -40,51 +40,30 @@
}; };
}; };
outputs = inputs @ { outputs = inputs @ {
self,
unstable, unstable,
nixos-generators, nixos-generators,
... ...
}: let }: let
inherit (unstable) lib; lib = import ./lib inputs;
importAll = path:
builtins.filter (lib.hasSuffix ".nix")
(lib.filesystem.listFilesRecursive path);
mkSystems = system: names:
lib.genAttrs names (
name:
lib.nixosSystem {
inherit system;
specialArgs = {inherit inputs self;};
modules =
importAll ./modules
++ importAll (self + "/systems/" + name);
}
);
mkDisko = names:
lib.genAttrs names (
name: (import (self + "/systems/" + name + "/disko.nix") {inherit inputs;})
);
withSystem = f:
lib.fold lib.recursiveUpdate {}
(map (s: f s) ["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"]);
in in
withSystem ( lib.withSystem (
system: let system: let
pkgs = unstable.legacyPackages.${system}; pkgs = unstable.legacyPackages.${system};
in { in {
inherit lib;
nixosConfigurations = nixosConfigurations =
mkSystems lib.mkSystems
"x86_64-linux" "x86_64-linux"
[ [
"gerg-desktop" "gerg-desktop"
"game-laptop" "game-laptop"
"moms-laptop" "moms-laptop"
]; ];
nixosModules = lib.mkModules ./modules;
diskoConfigurations = diskoConfigurations =
mkDisko lib.mkDisko
[ [
"gerg-desktop" "gerg-desktop"
"game-laptop" "game-laptop"
@ -108,16 +87,7 @@
]; ];
}; };
} }
// builtins.listToAttrs ( // lib.mkPkgs pkgs ./pkgs;
map (module: {
name = lib.removeSuffix ".nix" (builtins.baseNameOf module);
value = pkgs.callPackage module {};
})
(
builtins.filter (lib.hasSuffix ".nix")
(lib.filesystem.listFilesRecursive ./pkgs)
)
);
} }
); );
} }

View file

@ -1,4 +1,4 @@
{ _: {
pkgs, pkgs,
config, config,
... ...

View file

@ -1,10 +1,6 @@
{ {disko, ...}: {disks ? [], ...}: {
inputs,
disks ? [],
...
}: {
dummyvalue = {inherit disks;}; dummyvalue = {inherit disks;};
imports = [inputs.disko.nixosModules.disko]; imports = [disko.nixosModules.disko];
disko.devices = { disko.devices = {
disk.nvme0n1 = { disk.nvme0n1 = {
device = "/dev/disk/by-id/nvme-WDC_PC_SN530_SDBPNPZ-512G-1006_21311N802456"; device = "/dev/disk/by-id/nvme-WDC_PC_SN530_SDBPNPZ-512G-1006_21311N802456";

View file

@ -1,18 +1,11 @@
{config, ...}: { _: {config, ...}: {
hardware.nvidia = { hardware.nvidia = {
package = config.boot.kernelPackages.nvidiaPackages.latest; package = config.boot.kernelPackages.nvidiaPackages.latest;
prime = { prime = {
offload = { sync.enable = true;
enable = true;
enableOffloadCmd = true;
};
amdgpuBusId = "PCI:5:0:0"; amdgpuBusId = "PCI:5:0:0";
nvidiaBusId = "PCI:1:0:0"; nvidiaBusId = "PCI:1:0:0";
}; };
powerManagement = {
enable = true;
finegrained = true;
};
nvidiaPersistenced = true; nvidiaPersistenced = true;
nvidiaSettings = false; nvidiaSettings = false;
modesetting.enable = true; modesetting.enable = true;

View file

@ -1,4 +1,4 @@
{ _:{
containers."minecraft" = { containers."minecraft" = {
ephemeral = true; ephemeral = true;
autoStart = true; autoStart = true;

View file

@ -1,4 +1,4 @@
{ _:{
sops.secrets = { sops.secrets = {
"website/sql_gitea" = { "website/sql_gitea" = {
mode = "0444"; mode = "0444";

View file

@ -1,5 +1,4 @@
{ {nvim-flake, ...}: {
inputs,
pkgs, pkgs,
config, config,
... ...
@ -54,7 +53,7 @@
webcord webcord
prismlauncher prismlauncher
; ;
inherit (inputs.nvim-flake.packages.${pkgs.system}) neovim; inherit (nvim-flake.packages.${pkgs.system}) neovim;
}; };
etc = { etc = {
"jdks/17".source = pkgs.openjdk17 + /bin; "jdks/17".source = pkgs.openjdk17 + /bin;

View file

@ -1,10 +1,6 @@
{ {disko, ...}: {disks ? [], ...}: {
inputs,
disks ? [],
...
}: {
dummyvalue = {inherit disks;}; dummyvalue = {inherit disks;};
imports = [inputs.disko.nixosModules.disko]; imports = [disko.nixosModules.disko];
disko.devices = { disko.devices = {
disk = { disk = {
nvme0 = { nvme0 = {

View file

@ -1,7 +1,6 @@
{ {self, ...}: {
pkgs, pkgs,
config, config,
self,
lib, lib,
... ...
}: { }: {

View file

@ -1,15 +1,13 @@
{ {spicetify-nix, ...}: {pkgs, ...}: let
inputs, spicePkgs = spicetify-nix.legacyPackages.${pkgs.system};
pkgs,
...
}: let
spicePkgs = inputs.spicetify-nix.packages.${pkgs.system}.default;
ex = spicePkgs.extensions; ex = spicePkgs.extensions;
in { in {
imports = [spicetify-nix.nixosModule];
nixpkgs.allowedUnfree = ["spotify"]; nixpkgs.allowedUnfree = ["spotify"];
imports = [inputs.spicetify-nix.nixosModule];
programs.spicetify = { programs.spicetify = {
enable = true; enable = true;
spotifyPackage = spicePkgs.spotify;
spicetifyPackage = spicePkgs.spicetify-cli;
enabledExtensions = [ enabledExtensions = [
ex.adblock ex.adblock
ex.hidePodcasts ex.hidePodcasts

View file

@ -1,9 +1,11 @@
{ {
pkgs,
self, self,
pipewire_fix,
...
}: {
pkgs,
config, config,
lib, lib,
inputs,
... ...
}: }:
###TAKEN FROM HERE:https://github.com/NixOS/nixpkgs/blob/4787ebf7ae2ab071389be7ff86cf38edeee7e9f8/nixos/modules/services/x11/xserver.nix#L106-L136 ###TAKEN FROM HERE:https://github.com/NixOS/nixpkgs/blob/4787ebf7ae2ab071389be7ff86cf38edeee7e9f8/nixos/modules/services/x11/xserver.nix#L106-L136
@ -48,7 +50,7 @@ let
twoMonitor = pkgs.writeText "2-monitor.conf" (lib.concatStrings [(builtins.readFile xserverbase) (builtins.readFile (self + /misc/2-monitor.conf))]); twoMonitor = pkgs.writeText "2-monitor.conf" (lib.concatStrings [(builtins.readFile xserverbase) (builtins.readFile (self + /misc/2-monitor.conf))]);
in { in {
####VM SOUND BORKED ####VM SOUND BORKED
services.pipewire.package = inputs.pipewire_fix.legacyPackages.${pkgs.system}.pipewire; services.pipewire.package = pipewire_fix.legacyPackages.${pkgs.system}.pipewire;
boot = { boot = {
kernelParams = ["amd_iommu=on" "iommu=pt" "vfio_iommu_type1.allow_unsafe_interrupts=1" "kvm.ignore_msrs=1"]; kernelParams = ["amd_iommu=on" "iommu=pt" "vfio_iommu_type1.allow_unsafe_interrupts=1" "kvm.ignore_msrs=1"];
}; };

View file

@ -1,4 +1,4 @@
{ _: {
config, config,
lib, lib,
... ...

View file

@ -1,4 +1,4 @@
{ _: {
pkgs, pkgs,
config, config,
... ...

View file

@ -1,10 +1,6 @@
{ {disko, ...}: {disks ? [], ...}: {
inputs,
disks ? [],
...
}: {
dummyvalue = {inherit disks;}; dummyvalue = {inherit disks;};
imports = [inputs.disko.nixosModules.disko]; imports = [disko.nixosModules.disko];
disko.devices = { disko.devices = {
disk.sda = { disk.sda = {
device = "/dev/disk/by-id/ata-WDC_WDS240G2G0A-00JH30_180936803144"; device = "/dev/disk/by-id/ata-WDC_WDS240G2G0A-00JH30_180936803144";

View file

@ -1,4 +1,4 @@
{pkgs, ...}: { _: {pkgs, ...}: {
nixpkgs.allowedUnfree = ["hplip"]; nixpkgs.allowedUnfree = ["hplip"];
environment.systemPackages = [ environment.systemPackages = [
pkgs.gimp pkgs.gimp

61
lib/default.nix Normal file
View file

@ -0,0 +1,61 @@
inputs @ {
unstable,
self,
...
}: let
inherit (unstable) lib;
importAll = path:
map
(module: (import module inputs))
(
builtins.filter (lib.hasSuffix ".nix")
(lib.filesystem.listFilesRecursive path)
);
mkModules = path:
lib.listToAttrs (
map (
name: {
name = lib.removePrefix (toString path + "/") (lib.removeSuffix ".nix" (toString name));
value = import name inputs;
}
)
(
builtins.filter (lib.hasSuffix ".nix")
(lib.filesystem.listFilesRecursive path)
)
);
in {
inherit importAll mkModules;
withSystem = f:
lib.fold lib.recursiveUpdate {}
(map f ["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"]);
mkSystems = system: names:
lib.genAttrs names (
name:
lib.nixosSystem {
inherit system;
modules =
builtins.attrValues self.nixosModules ++ importAll (self + "/hosts/" + name);
}
);
mkDisko = names:
lib.genAttrs names (
name: (import (self + "/hosts/" + name + "/disko.nix") inputs)
);
mkPkgs = pkgs: path:
builtins.listToAttrs (
map (module: {
name = lib.removeSuffix ".nix" (builtins.baseNameOf module);
value = pkgs.callPackage module {};
})
(
builtins.filter (lib.hasSuffix ".nix")
(lib.filesystem.listFilesRecursive path)
)
);
}

View file

@ -1,9 +1,11 @@
{ {
inputs, suckless,
self,
...
}: {
pkgs, pkgs,
config, config,
lib, lib,
self,
... ...
}: { }: {
options.localModules.DE.dwm.enable = lib.mkEnableOption ""; options.localModules.DE.dwm.enable = lib.mkEnableOption "";
@ -45,7 +47,7 @@
}; };
environment.systemPackages = builtins.attrValues { environment.systemPackages = builtins.attrValues {
inherit inherit
(inputs.suckless.packages.${pkgs.system}) (suckless.packages.${pkgs.system})
dmenu dmenu
dwm dwm
st st

View file

@ -1,4 +1,4 @@
{ _: {
config, config,
lib, lib,
pkgs, pkgs,

View file

@ -1,4 +1,4 @@
{ _: {
config, config,
lib, lib,
pkgs, pkgs,

View file

@ -1,4 +1,4 @@
{ _: {
config, config,
lib, lib,
... ...

View file

@ -1,7 +1,6 @@
{ {self, ...}: {
config, config,
lib, lib,
self,
pkgs, pkgs,
... ...
}: { }: {

View file

@ -1,4 +1,4 @@
{ _: {
config, config,
pkgs, pkgs,
lib, lib,

View file

@ -1,5 +1,4 @@
{ {self, ...}: {
self,
lib, lib,
pkgs, pkgs,
... ...

View file

@ -1,15 +1,16 @@
{ {unstable, ...}: {
inputs,
lib, lib,
config, config,
pkgs, pkgs,
... ...
}: let }:
#TAKEN FROM https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/system/boot/stage-2.nix
let
useHostResolvConf = config.networking.resolvconf.enable && config.networking.useHostResolvConf; useHostResolvConf = config.networking.resolvconf.enable && config.networking.useHostResolvConf;
bootStage2 = pkgs.substituteAll { bootStage2 = pkgs.substituteAll {
src = pkgs.runCommand "stage-2-init.sh" {} '' src = pkgs.runCommand "stage-2-init.sh" {} ''
sed '2i exec 1<>/dev/null' ${inputs.unstable}/nixos/modules/system/boot/stage-2-init.sh > $out sed '2i exec 1<>/dev/null' ${unstable}/nixos/modules/system/boot/stage-2-init.sh > $out
''; '';
shellDebug = "${pkgs.bashInteractive}/bin/bash"; shellDebug = "${pkgs.bashInteractive}/bin/bash";
shell = "${pkgs.bash}/bin/bash"; shell = "${pkgs.bash}/bin/bash";

View file

@ -1,4 +1,4 @@
{ _: {
config, config,
lib, lib,
... ...

27
modules/direnv.nix Normal file
View file

@ -0,0 +1,27 @@
_: {pkgs, ...}: {
environment = {
systemPackages = builtins.attrValues {
inherit
(pkgs)
nix-direnv
direnv
;
};
variables = {
DIRENV_LOG_FORMAT = "";
DIRENV_CONFIG = "${pkgs.nix-direnv}/share/nix-direnv";
};
};
programs = {
zsh.interactiveShellInit = ''
eval "$(direnv hook zsh)"
'';
bash.interactiveShellInit = ''
eval "$(direnv hook bash)"
'';
fish.interactiveShellInit = ''
direnv hook fish | source
'';
};
}

View file

@ -1,4 +1,4 @@
{ _: {
pkgs, pkgs,
config, config,
lib, lib,

View file

@ -1,4 +1,4 @@
{ _: {
config, config,
lib, lib,
... ...

View file

@ -1,4 +1,4 @@
{ _: {
lib, lib,
config, config,
pkgs, pkgs,

View file

@ -1,34 +1,4 @@
{ inputs: {pkgs, ...}: {
pkgs,
inputs,
lib,
self,
...
}: let
combined_flakes =
(
#filter non-flakes from inputs
lib.filterAttrs (
_: value: (
!(lib.hasAttrByPath ["flake"] value) || !value.flake
)
)
inputs
)
// {
#alias unstable
nixpkgs = inputs.unstable;
#add system flake
system = self;
};
in {
#create registry from input flakes
nix.registry = lib.mapAttrs (_: value: {flake = value;}) combined_flakes;
#add all inputs to etc
environment.etc = lib.mapAttrs' (name: value: lib.nameValuePair "/nixpath/${name}" {source = value;}) combined_flakes;
#source the etc paths to nixPath
nix.nixPath = lib.mapAttrsToList (name: _: name + "=/etc/nixpath/${name}") combined_flakes;
#other nix settings #other nix settings
nix = { nix = {
package = inputs.nix.packages.${pkgs.system}.default; package = inputs.nix.packages.${pkgs.system}.default;

12
modules/pinning.nix Normal file
View file

@ -0,0 +1,12 @@
inputs: {lib, ...}: let
alias = inputs // {nixpkgs = inputs.unstable;};
in
lib.pipe alias [
(lib.filterAttrs (_: v: v._type == "flake"))
(lib.mapAttrsToList (n: input: {
environment.etc."nixpath/${n}".source = input.outPath;
nix.nixPath = ["${n}=/etc/nixpath/${n}"];
nix.registry.${n}.flake = input;
}))
lib.mkMerge
]

View file

@ -1,5 +1,4 @@
{ {fetch-rs, ...}: {
inputs,
pkgs, pkgs,
config, config,
lib, lib,
@ -11,11 +10,9 @@
(pkgs) (pkgs)
page page
exa exa
direnv
nix-direnv
; ;
inherit inherit
(inputs.fetch-rs.packages.${pkgs.system}) (fetch-rs.packages.${pkgs.system})
fetch-rs fetch-rs
; ;
}; };
@ -25,13 +22,13 @@
VISUAL = "nvim"; VISUAL = "nvim";
PAGER = "page"; PAGER = "page";
SYSTEMD_PAGERSECURE = "true"; SYSTEMD_PAGERSECURE = "true";
DIRENV_LOG_FORMAT = "";
}; };
shellAliases = { shellAliases = {
#make sudo use aliases #make sudo use aliases
sudo = "sudo "; sudo = "sudo ";
#paste link trick #paste link trick
pastebin = "curl -F 'clbin=<-' https://clbin.com"; pastebin = "curl -F 'clbin=<-' https://clbin.com";
termbin = "nc termbin.com 9999";
#nix stuff #nix stuff
gc-check = "nix-store --gc --print-roots | egrep -v \"^(/nix/var|/run/\w+-system|\{memory|/proc)\""; gc-check = "nix-store --gc --print-roots | egrep -v \"^(/nix/var|/run/\w+-system|\{memory|/proc)\"";
#vim stuff #vim stuff
@ -49,9 +46,6 @@
lt = "exa --tree --level=2"; lt = "exa --tree --level=2";
}; };
interactiveShellInit = "fetch-rs"; interactiveShellInit = "fetch-rs";
pathsToLink = [
"/share/nix-direnv"
];
}; };
security.sudo = { security.sudo = {
enable = true; enable = true;
@ -72,24 +66,29 @@
syntaxHighlighting.enable = true; syntaxHighlighting.enable = true;
histSize = 10000; histSize = 10000;
histFile = "$HOME/.cache/zsh_history"; histFile = "$HOME/.cache/zsh_history";
shellInit = ''
eval "$(direnv hook zsh)"
'';
}; };
#starship #starship
starship = { starship = {
enable = true; enable = true;
settings = { settings = {
add_newline = false; add_newline = false;
format = "$sudo\${custom.direnv} $cmd_duration \n $directory$git_branch$character"; format = "$sudo$nix_shell\${custom.direnv}$cmd_duration\n$git_metrics$git_state$git_branch\n$directory$character";
character = { character = {
success_symbol = "[ ](#9ece6a bold)"; success_symbol = "[\\$](#9ece6a bold)";
error_symbol = "[ ](#db4b4b bold)"; error_symbol = "[\\$](#db4b4b bold)";
};
nix_shell = {
format = "[󱄅 ](#74b2ff)";
heuristic = true;
}; };
directory = { directory = {
read_only = " "; read_only = " ";
}; };
git_metrics = {
disabled = false;
};
git_branch = { git_branch = {
format = "[$symbol$branch(:$remote_branch)]($style)";
style = "bold red"; style = "bold red";
}; };
sudo = { sudo = {
@ -103,7 +102,7 @@
custom.direnv = { custom.direnv = {
format = "[\\[direnv\\]]($style)"; format = "[\\[direnv\\]]($style)";
style = "#36c692"; style = "#36c692";
detect_folders = [".direnv"]; when = "printenv DIRENV_FILE";
}; };
}; };
}; };

View file

@ -1,18 +1,20 @@
{ {
inputs, sops-nix,
pkgs,
self, self,
...
}: {
pkgs,
config, config,
... ...
}: { }: {
imports = [ imports = [
inputs.sops-nix.nixosModules.sops sops-nix.nixosModules.sops
]; ];
environment.systemPackages = [ environment.systemPackages = [
pkgs.sops pkgs.sops
]; ];
sops = { sops = {
defaultSopsFile = self + "/systems/" + config.networking.hostName + "/secrets.yaml"; defaultSopsFile = self + "/hosts/" + config.networking.hostName + "/secrets.yaml";
age.sshKeyPaths = ["/etc/ssh/ssh_host_ed25519_key"]; age.sshKeyPaths = ["/etc/ssh/ssh_host_ed25519_key"];
}; };
} }

View file

@ -1,4 +1,4 @@
{ _: {
pkgs, pkgs,
config, config,
lib, lib,

View file

@ -49,5 +49,5 @@ in
mkdir -p $out/share/icons/hicolor/256x256/apps/ mkdir -p $out/share/icons/hicolor/256x256/apps/
cp $src/afk-icon.png $out/share/icons/hicolor/256x256/apps/afk-icon.png cp $src/afk-icon.png $out/share/icons/hicolor/256x256/apps/afk-icon.png
''; '';
cargoSha256 = "sha256-CPpFUdgb0zTZAVlv4uhJ0Y7eocCjuEZNgQJdNwV1FI4="; cargoSha256 = "sha256-r20g5Tkj2ft1ho/fghg+qwiGOUay8HCIrBbg+y8kQXQ=";
} }

View file

@ -8,7 +8,6 @@
imagemagick_light, imagemagick_light,
libglvnd, libglvnd,
libxcb, libxcb,
makeWrapper,
ocl-icd, ocl-icd,
opencl-headers, opencl-headers,
pciutils, pciutils,
@ -31,7 +30,7 @@ stdenv.mkDerivation (finalAttrs: {
hash = "sha256-sSQaXXKH/ZELdhbUKuvAj0gZ0fSO/Xjxsv/TU0Xq47k="; hash = "sha256-sSQaXXKH/ZELdhbUKuvAj0gZ0fSO/Xjxsv/TU0Xq47k=";
}; };
nativeBuildInputs = [cmake makeWrapper pkg-config]; nativeBuildInputs = [cmake pkg-config];
buildInputs = [ buildInputs = [
dbus dbus

View file

@ -24,19 +24,21 @@ in
pname = "parrot"; pname = "parrot";
version = "1.6.0"; version = "1.6.0";
inherit src; inherit src;
buildInputs = [
libopus
openssl
];
nativeBuildInputs = [ nativeBuildInputs = [
pkg-config pkg-config
cmake cmake
makeWrapper makeWrapper
]; ];
buildInputs = [
libopus
openssl
];
postInstall = '' postInstall = ''
wrapProgram $out/bin/parrot \ wrapProgram $out/bin/parrot \
--set PATH ${lib.makeBinPath [ --prefix PATH ${lib.makeBinPath [
yt-dlp yt-dlp
ffmpeg ffmpeg
]}''; ]}'';

View file

@ -9,13 +9,12 @@
exec ${glibc}/lib64/ld-linux-x86-64.so.2 \ exec ${glibc}/lib64/ld-linux-x86-64.so.2 \
$out/t-rex --no-watchdog \$@ $out/t-rex --no-watchdog \$@
''; '';
version = "0.26.5";
in in
stdenv.mkDerivation { stdenv.mkDerivation (finalAttrs: {
inherit version; version = "0.26.5";
pname = "t-rex-miner"; pname = "t-rex-miner";
src = fetchzip { src = fetchzip {
url = "https://github.com/trexminer/T-Rex/releases/download/${version}/t-rex-${version}-linux.tar.gz"; url = "https://github.com/trexminer/T-Rex/releases/download/${finalAttrs.version}/t-rex-${finalAttrs.version}-linux.tar.gz";
sha256 = "sha256-eGOTfb03R2ck/6GMY6tPmTifYT9aVv3dNDQ5jRVlz58="; sha256 = "sha256-eGOTfb03R2ck/6GMY6tPmTifYT9aVv3dNDQ5jRVlz58=";
stripRoot = false; stripRoot = false;
}; };
@ -26,4 +25,4 @@ in
echo "${wrapper}" > $out/bin/t-rex echo "${wrapper}" > $out/bin/t-rex
chmod +x $out/bin/t-rex chmod +x $out/bin/t-rex
''; '';
} })