flake: refactor lib a bit, hosts: put more hardware stuff in hardware

This commit is contained in:
Gabriel Fontes
2022-08-08 15:50:54 -03:00
parent 504c1483a8
commit a1bff8dd12
16 changed files with 87 additions and 96 deletions
Generated
+18 -18
View File
@@ -25,11 +25,11 @@
"utils": "utils"
},
"locked": {
"lastModified": 1653594315,
"narHash": "sha256-kJ0ENmnQJ4qL2FeYKZba9kvv1KmIuB3NVpBwMeI7AJQ=",
"lastModified": 1659725433,
"narHash": "sha256-1ZxuK67TL29YLw88vQ18Y2Y6iYg8Jb7I6/HVzmNB6nM=",
"owner": "serokell",
"repo": "deploy-rs",
"rev": "184349d8149436748986d1bdba087e4149e9c160",
"rev": "41f15759dd8b638e7b4f299730d94d5aa46ab7eb",
"type": "github"
},
"original": {
@@ -108,11 +108,11 @@
"utils": "utils_2"
},
"locked": {
"lastModified": 1659484873,
"narHash": "sha256-6VoPiGyDdjBHOJ3IpS24lY1lrDiOHeuEefOFI0qz3WE=",
"lastModified": 1659978484,
"narHash": "sha256-VkErPc8pXcuFQG7jkkaUOEMORe81oweRNlAYZJ2+aRI=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "d8d9ff0b2df77defa10375c6665b51f0251c34d6",
"rev": "c1addfdad3825f75a66f8d73ec7d2f68c78ba6f8",
"type": "github"
},
"original": {
@@ -129,11 +129,11 @@
"wlroots": "wlroots"
},
"locked": {
"lastModified": 1659475258,
"narHash": "sha256-ceVRZAq625ZHB3TUXfO5UxYjm0VC61azTb5eocbfcCo=",
"lastModified": 1659900450,
"narHash": "sha256-0gdviZ46VCUAOA0PJNvddgQJQqKnm5theFftSux6L04=",
"owner": "hyprwm",
"repo": "hyprland",
"rev": "d3c96c248cb556f51f89420aa46e8242746b9a29",
"rev": "9532ff42871615d3293f5fb679282e3423ff380d",
"type": "github"
},
"original": {
@@ -198,11 +198,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1659305579,
"narHash": "sha256-SFeQTmh7hc9Y2fSkooHaoS8mDfPa04sfmUCtQ8MA6Pg=",
"lastModified": 1659889440,
"narHash": "sha256-O8+FsHZzQIqjQjuh+VXbJtGrpPswm5ta2Z/eo72Lz2U=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "5857574d45925585baffde730369414319228a84",
"rev": "4bdf4169ad2896236895ca607a843f30c9680345",
"type": "github"
},
"original": {
@@ -245,11 +245,11 @@
},
"nur": {
"locked": {
"lastModified": 1659483824,
"narHash": "sha256-dJutEz8UQBi+g9GMBPJXnx54xn0Ow1a/JGV9Gxd9jpw=",
"lastModified": 1659979714,
"narHash": "sha256-9DCdRQvaQwMBln4S/YJTQ2ODnuwFkQlHRkXBIqM7SM4=",
"owner": "nix-community",
"repo": "NUR",
"rev": "3902a6de021f928e2d0f4b71565853507a525bd1",
"rev": "9885d9a250a732cefceed2c304f976c471226ab8",
"type": "github"
},
"original": {
@@ -388,11 +388,11 @@
"flake": false,
"locked": {
"host": "gitlab.freedesktop.org",
"lastModified": 1658770113,
"narHash": "sha256-VBq9vw0hvQPKGKLNKLJS8xsUHvrX0o2LUDBVolixenE=",
"lastModified": 1659738224,
"narHash": "sha256-bV3TLiCgptpKoUKLiH/5RMtiIsfn0hawdaCEHQFB6WY=",
"owner": "wlroots",
"repo": "wlroots",
"rev": "7b5e890e61a27375725068a7d1884b26851b3102",
"rev": "3baf2a6bcfc4cb86c364f5724aaec80f28715a01",
"type": "gitlab"
},
"original": {
+9 -31
View File
@@ -46,7 +46,7 @@
outputs = inputs:
let
lib = import ./lib { inherit inputs; };
inherit (lib) mkSystem mkHome mkDeploys importAttrset forAllSystems;
inherit (lib) mkSystem mkHome mkDeploys forAllSystems;
in
rec {
inherit lib;
@@ -54,7 +54,6 @@
overlays = {
default = import ./overlay { inherit inputs; };
nur = inputs.nur.overlay;
deploy-rs = inputs.deploy-rs.overlay;
peerix = inputs.peerix.overlay;
sops-nix = inputs.sops-nix.overlay;
hyprland = inputs.hyprland.overlays.default;
@@ -62,8 +61,8 @@
paste-misterio-me = inputs.paste-misterio-me.overlay;
};
nixosModules = importAttrset ./modules/nixos;
homeManagerModules = importAttrset ./modules/home-manager;
nixosModules = import ./modules/nixos;
homeManagerModules = import ./modules/home-manager;
templates = import ./templates;
@@ -74,7 +73,7 @@
apps = forAllSystems (system: rec {
deploy = {
type = "app";
program = "${legacyPackages.${system}.deploy-rs.deploy-rs}/bin/deploy";
program = "${legacyPackages.${system}.deploy-rs}/bin/deploy";
};
default = deploy;
});
@@ -91,25 +90,25 @@
# Desktop
atlas = mkSystem {
hostname = "atlas";
system = "x86_64-linux";
pkgs = legacyPackages."x86_64-linux";
persistence = true;
};
# Laptop
pleione = mkSystem {
hostname = "pleione";
system = "x86_64-linux";
pkgs = legacyPackages."x86_64-linux";
persistence = true;
};
# Raspi 4
merope = mkSystem {
hostname = "merope";
system = "aarch64-linux";
pkgs = legacyPackages."aarch64-linux";
persistence = true;
};
# Vultr VPS
# VPS
electra = mkSystem {
hostname = "electra";
system = "x86_64-linux";
pkgs = legacyPackages."x86_64-linux";
persistence = true;
};
};
@@ -158,27 +157,6 @@
colorscheme = "solarflare";
};
# Generic configs
"misterio@generic" = mkHome {
username = "misterio";
system = "x86_64-linux";
colorscheme = "dracula";
};
"misterio@generic-graphical" = mkHome {
username = "misterio";
system = "x86_64-linux";
features = [ "desktop/gnome" ];
colorscheme = "dracula";
};
# GELOS lab computers
"misterio@emperor" = homeConfigurations."misterio@generic";
"misterio@galapagos" = homeConfigurations."misterio@generic";
"misterio@macaroni" = homeConfigurations."misterio@generic-graphical";
"misterio@rockhopper" = homeConfigurations."misterio@generic-graphical";
};
deploy.nodes = mkDeploys nixosConfigurations homeConfigurations;
-1
View File
@@ -29,7 +29,6 @@
jq # JSON pretty printer and manipulator
trekscii # Cute startrek cli printer
deploy-rs.deploy-rs # Deployment tool
sops # Deployment secrets tool
nvd nix-diff # Check derivation differences
rnix-lsp # Nix LSP
-1
View File
@@ -17,7 +17,6 @@
../common/optional/quietboot.nix
../common/optional/starcitizen-fixes.nix
../common/optional/steam.nix
../common/optional/systemd-boot.nix
../common/optional/tailscale.nix
];
+9
View File
@@ -9,6 +9,13 @@
availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
kernelModules = [ "kvm-amd" ];
};
loader = {
systemd-boot = {
enable = true;
consoleMode = "max";
};
efi.canTouchEfiVariables = true;
};
};
fileSystems = {
@@ -18,4 +25,6 @@
};
};
nixpkgs.hostPlatform.system = "x86_64-linux";
}
+1 -8
View File
@@ -8,14 +8,7 @@
./services
];
boot = {
loader.grub = {
enable = true;
version = 2;
device = "/dev/vda";
};
};
networking.useDHCP = true;
system.stateVersion = "22.05";
}
+15 -5
View File
@@ -1,16 +1,26 @@
{ config, lib, ... }:
{
imports = [
../common/optional/btrfs-optin-persistence.nix
];
boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "sr_mod" "virtio_blk" ];
networking.useDHCP = lib.mkDefault true;
boot = {
initrd = {
availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "sr_mod" "virtio_blk" ];
};
loader = {
grub = {
enable = true;
version = 2;
device = "/dev/vda";
};
};
};
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
hardware.cpu.intel.updateMicrocode = true;
virtualisation.hypervGuest.enable = true;
systemd.services.hv-kvp.unitConfig.ConditionPathExists = [ "/dev/vmbus/hv_kvp" ];
nixpkgs.hostPlatform.system = "x86_64-linux";
}
-2
View File
@@ -30,8 +30,6 @@
};
};
boot.loader.timeout = 5;
# Enable argonone fan daemon
services.hardware.argonone.enable = true;
+5 -1
View File
@@ -1,12 +1,14 @@
{
imports = [
../common/optional/btrfs-optin-persistence.nix
../common/optional/btrfs-optin-persistence.nix
];
boot = {
initrd = {
availableKernelModules = [ "xhci_pci" ];
};
loader.timeout = 5;
};
fileSystems = {
@@ -27,5 +29,7 @@
};
};
nixpkgs.hostPlatform.system = "aarch64-linux";
powerManagement.cpuFreqGovernor = "ondemand";
}
-1
View File
@@ -14,7 +14,6 @@
../common/optional/postgres.nix
../common/optional/quietboot.nix
../common/optional/steam.nix
../common/optional/systemd-boot.nix
../common/optional/tailscale.nix
];
+9
View File
@@ -9,6 +9,13 @@
availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "sd_mod" ];
kernelModules = [ "kvm-amd" ];
};
loader = {
systemd-boot = {
enable = true;
consoleMode = "max";
};
efi.canTouchEfiVariables = true;
};
};
fileSystems = {
@@ -18,5 +25,7 @@
};
};
nixpkgs.hostPlatform.system = "x86_64-linux";
powerManagement.cpuFreqGovernor = "powersave";
}
+6 -13
View File
@@ -27,42 +27,35 @@ rec {
];
forAllSystems = genAttrs systems;
importAttrset = path: mapAttrs (_: import) (import path);
mkSystem =
{ hostname
, system
, pkgs
, persistence ? false
}:
nixosSystem {
inherit system;
pkgs = outputs.legacyPackages.${system};
inherit pkgs;
specialArgs = {
inherit inputs outputs hostname persistence;
};
modules = attrValues (import ../modules/nixos) ++ [
../hosts/${hostname}
];
modules = attrValues (import ../modules/nixos) ++ [ ../hosts/${hostname} ];
};
mkHome =
{ username
, hostname ? null
, system ? outputs.nixosConfigurations.${hostname}.pkgs.system
, pkgs ? outputs.nixosConfigurations.${hostname}.pkgs
, persistence ? false
, colorscheme ? null
, wallpaper ? null
, features ? [ ]
}:
homeManagerConfiguration {
pkgs = outputs.legacyPackages.${system};
inherit pkgs;
extraSpecialArgs = {
inherit inputs outputs hostname username persistence
colorscheme wallpaper features;
};
modules = attrValues (import ../modules/home-manager) ++ [
../home/${username}
];
modules = attrValues (import ../modules/home-manager) ++ [ ../home/${username} ];
};
mkDeploys = nixosConfigs: homeConfigs:
+8 -8
View File
@@ -1,10 +1,10 @@
{
afuse = ./afuse.nix;
rgbdaemon = ./rgbdaemon.nix;
wallpaper = ./wallpaper.nix;
shellcolor = ./shellcolor.nix;
fonts = ./fonts.nix;
preferred-apps = ./preferred-apps.nix;
swaylock = ./swaylock.nix;
xpo = ./xpo.nix;
afuse = import ./afuse.nix;
rgbdaemon = import ./rgbdaemon.nix;
wallpaper = import ./wallpaper.nix;
shellcolor = import ./shellcolor.nix;
fonts = import ./fonts.nix;
preferred-apps = import ./preferred-apps.nix;
swaylock = import ./swaylock.nix;
xpo = import ./xpo.nix;
}
+2 -2
View File
@@ -1,4 +1,4 @@
{
openrgb = ./openrgb.nix;
satisfactory = ./satisfactory.nix;
openrgb = import ./openrgb.nix;
satisfactory = import ./satisfactory.nix;
}
+4 -4
View File
@@ -1,7 +1,7 @@
{ inputs, ... }:
let
# Adds my custom packages
additions = final: prev: import ../pkgs { pkgs = prev; };
additions = final: _prev: import ../pkgs { pkgs = final; };
# Modifies existing packages
modifications = final: prev: {
@@ -15,14 +15,14 @@ let
vim-nix = prev.vimPlugins.vim-nix.overrideAttrs
(_oldAttrs: rec {
version = "2022-02-20";
src = prev.fetchFromGitHub {
src = final.fetchFromGitHub {
owner = "hqurve";
repo = "vim-nix";
rev = "26abd9cb976b5f4da6da02ee81449a959027b958";
sha256 = "sha256-7TDW6Dgy/H7PRrIvTMpmXO5/3K5F1d4p3rLYon6h6OU=";
};
});
} // import ../pkgs/vim-plugins { pkgs = prev; };
} // import ../pkgs/vim-plugins { pkgs = final; };
# Don't launch discord when using discocss
discocss = prev.discocss.overrideAttrs (oldAttrs: rec {
@@ -44,7 +44,7 @@ let
pfetch = prev.pfetch.overrideAttrs (oldAttrs: {
version = "unstable-2021-12-10";
src = prev.fetchFromGitHub {
src = final.fetchFromGitHub {
owner = "dylanaraps";
repo = "pfetch";
rev = "a906ff89680c78cec9785f3ff49ca8b272a0f96b";
+1 -1
View File
@@ -8,7 +8,7 @@ mkShell {
# Para deploy
gnupg
age
deploy-rs.deploy-rs
deploy-rs
sops
];
}