Reorganize files

This commit is contained in:
Henry Hiles 2023-12-24 11:01:25 -05:00
parent 2fc4f2dd4a
commit a32dfc1089
32 changed files with 260 additions and 398 deletions

42
flake.lock generated
View file

@ -133,11 +133,11 @@
"firefox-gnome-theme": {
"flake": false,
"locked": {
"lastModified": 1701370547,
"narHash": "sha256-pCtPIcRnMMJOwAlNh5qTO00uw/PBThIIzjMCRcCyHYw=",
"lastModified": 1703023593,
"narHash": "sha256-M+Cw6vh7xCDmIhyVuEPNmaNVUwpmdFQq8zlsXZTKees=",
"owner": "rafaelmardojai",
"repo": "firefox-gnome-theme",
"rev": "ec9421f82d922b7293ffd45a47f7abdee80038c6",
"rev": "bad853333d9021e7012adb9b8fbfe7a7003f26bc",
"type": "github"
},
"original": {
@ -203,11 +203,11 @@
]
},
"locked": {
"lastModified": 1701728041,
"narHash": "sha256-x0pyrI1vC8evVDxCxyO6olOyr4wlFg9+VS3C3p4xFYQ=",
"lastModified": 1703178811,
"narHash": "sha256-Orbqa8DvszYZ38XGWAs43hVs++czt2N6/Y0sFRLhJms=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "ac7216918cd65f3824ba7817dea8f22e61221eaf",
"rev": "fb5ac0c870a1b3ffea70e02ab1720d991ce812ae",
"type": "github"
},
"original": {
@ -243,11 +243,11 @@
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1701611132,
"narHash": "sha256-roFYOQhIrZ0DUlWbughOwHzx/PoEMrK0inJbFeuOySg=",
"lastModified": 1703207739,
"narHash": "sha256-KG8hgOj5OGm0kkS3PWEHCidv1IqgsT7+Cb48/IJhrrc=",
"owner": "fufexan",
"repo": "nix-gaming",
"rev": "6a885e460cf8596aa23d6f043aa10219494f1da8",
"rev": "d8be07e1b418b71ff902fd05e2f7ad4e6cc4a10e",
"type": "github"
},
"original": {
@ -258,11 +258,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1701336116,
"narHash": "sha256-kEmpezCR/FpITc6yMbAh4WrOCiT2zg5pSjnKrq51h5Y=",
"lastModified": 1702539185,
"narHash": "sha256-KnIRG5NMdLIpEkZTnN5zovNYc0hhXjAgv6pfd5Z4c7U=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "f5c27c6136db4d76c30e533c20517df6864c46ee",
"rev": "aa9d4729cbc99dabacb50e3994dcefb3ea0f7447",
"type": "github"
},
"original": {
@ -307,11 +307,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1701436327,
"narHash": "sha256-tRHbnoNI8SIM5O5xuxOmtSLnswEByzmnQcGGyNRjxsE=",
"lastModified": 1703013332,
"narHash": "sha256-+tFNwMvlXLbJZXiMHqYq77z/RfmpfpiI3yjL6o/Zo9M=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "91050ea1e57e50388fa87a3302ba12d188ef723a",
"rev": "54aac082a4d9bb5bbc5c4e899603abfb76a3f6d6",
"type": "github"
},
"original": {
@ -345,11 +345,11 @@
"utils": "utils"
},
"locked": {
"lastModified": 1701724946,
"narHash": "sha256-U5Q21HDFz3Ba31bqYhB/mfiJKOSD0s2Dc4aeNG6CcXo=",
"lastModified": 1703189725,
"narHash": "sha256-jyuUb2W8/BAocmSVRxzwZjAG0IBicpKdMxIzQVzfPAM=",
"owner": "wamserma",
"repo": "flake-programs-sqlite",
"rev": "7d5f27049db2261da0b2da5a2fcc168ef9511ed2",
"rev": "20bdf3d48e601915ae594bd4038c2e21d5c4c39f",
"type": "github"
},
"original": {
@ -384,11 +384,11 @@
"nixpkgs": "nixpkgs_3"
},
"locked": {
"lastModified": 1701532764,
"narHash": "sha256-Jrizp/nITbul2HBIraQRDw5lyJnzTsj0K9wZUFYX2gg=",
"lastModified": 1703004037,
"narHash": "sha256-ceYPl/ML0kQBCUaOw0gG2TxHHEl4k9xivFpsdlKidIQ=",
"owner": "danth",
"repo": "stylix",
"rev": "17a452c5d58bb90057d49c7e3e613b5e6dc1c0f4",
"rev": "d14ac4912a9ab02f8b49b761e9e4b9ae836171af",
"type": "github"
},
"original": {

View file

@ -25,32 +25,38 @@
home-manager,
...
} @ inputs: let
system = hostname:
system = hostname: isDesktop: let
opt = nixpkgs.lib.optionals;
dirFiles = dir: map (file: "${dir}/${file}") (builtins.attrNames (builtins.readDir dir));
hostHasFile = file: (builtins.pathExists "${self}/${hostname}/${file}");
in
nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
inherit inputs self;
};
modules =
[
./common.nix
"${self}/${hostname}/configuration.nix"
"${self}/${hostname}/hardware-configuration.nix"
inputs.nix-gaming.nixosModules.pipewireLowLatency
]
++ nixpkgs.lib.optionals (builtins.pathExists "${self}/${hostname}/home-manager.nix") [
"${self}/${hostname}/home-manager.nix"
++ dirFiles ./modules/common
++ opt isDesktop dirFiles ./modules/common-desktop
++ opt (hostHasFile "home-manager.nix") [
home-manager.nixosModules.home-manager
"${self}/${hostname}/home-manager.nix"
]
++ nixpkgs.lib.optionals (builtins.pathExists "${self}/${hostname}/stylix.nix") [
++ opt (hostHasFile "stylix.nix") [
stylix.nixosModules.stylix
"${self}/${hostname}/stylix.nix"
];
};
in {
nixosConfigurations = {
"quadraticpc" = system "quadraticpc";
"quadtop" = system "quadtop";
"quadraticpc" = system "quadraticpc" true;
"quadtop" = system "quadtop" true;
};
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.alejandra;

View file

@ -66,8 +66,6 @@
"[astro]" = {
"editor.defaultFormatter" = "astro-build.astro-vscode";
};
"prettier.trailingComma" = "none";
"prettier.useTabs" = true;
"editor.minimap.enabled" = false;
"diffEditor.ignoreTrimWhitespace" = false;
"editor.unicodeHighlight.nonBasicASCII" = false;
@ -84,9 +82,8 @@
};
"nix.enableLanguageServer" = true;
"nix.serverPath" = lib.meta.getExe pkgs.nil;
"nix.serverSettings"."nil" = {
formatting.command = [(lib.meta.getExe pkgs.alejandra)];
};
"nix.formatterPath" = lib.meta.getExe pkgs.alejandra;
"indentRainbow.ignoreErrorLanguages" = ["*"];
};
};
}

View file

@ -0,0 +1,10 @@
{
environment.sessionVariables.NIXOS_OZONE_WL = "1";
services.xserver = {
enable = true;
displayManager.gdm.enable = true;
desktopManager.gnome.enable = true;
layout = "us";
};
}

View file

@ -0,0 +1,4 @@
{
programs.gamemode.enable = true;
environment.sessionVariables.GAMEMODERUNEXEC = "nvidia-offload";
}

View file

@ -0,0 +1,13 @@
{pkgs, ...}: {
environment.systemPackages = with pkgs.gnomeExtensions; [
caffeine
pop-shell
appindicator
search-light
blur-my-shell
just-perfection
burn-my-windows
fullscreen-avoider
compiz-windows-effect
];
}

View file

@ -0,0 +1 @@
{programs.noisetorch.enable = true;}

View file

@ -0,0 +1,7 @@
{
hardware.opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
};
}

View file

@ -0,0 +1,27 @@
{pkgs, inputs, ...}: {
environment.systemPackages = with pkgs; [
fd
tldr
tuba
gimp
heroic
aspell
killall
ripgrep
hyfetch
inkscape
r2modman
pciutils
monophony
alejandra
grapejuice
impression
libreoffice
virt-manager
wl-clipboard
protontricks
android-studio
hunspellDicts.en_CA-large
inputs.nix-gaming.packages.${system}.wine-ge
];
}

View file

@ -0,0 +1,12 @@
{
services.pipewire = {
enable = true;
alsa = {
enable = true;
support32Bit = true;
};
pulse.enable = true;
lowLatency.enable = true;
};
hardware.pulseaudio.enable = false;
}

View file

@ -0,0 +1 @@
{boot.plymouth.enable = true;}

View file

@ -0,0 +1,12 @@
{
services = {
avahi = {
enable = true;
nssmdns4 = true;
openFirewall = true;
};
gpm.enable = true;
printing.enable = true;
};
}

View file

@ -0,0 +1 @@
{system.stateVersion = "23.05";}

View file

@ -0,0 +1,12 @@
{
pkgs,
inputs,
...
}: {
programs.steam = {
enable = true;
package = pkgs.steam.override {
extraProfile = "export STEAM_EXTRA_COMPAT_TOOLS_PATHS='${inputs.nix-gaming.packages.${pkgs.system}.proton-ge}'";
};
};
}

View file

@ -0,0 +1 @@
{services.auto-cpufreq.enable = true;}

View file

@ -0,0 +1 @@
{self, ...}: {environment.etc."backup".source = self;}

10
modules/common/boot.nix Normal file
View file

@ -0,0 +1,10 @@
{pkgs, ...}: {
boot = {
loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
kernelPackages = pkgs.linuxPackages_zen;
kernelParams = ["sysrq_always_enabled=1"];
};
}

View file

@ -0,0 +1,8 @@
{
inputs,
pkgs,
...
}: {
programs.command-not-found.dbPath = "/etc/programs.sqlite";
environment.etc."programs.sqlite".source = inputs.programsdb.packages.${pkgs.system}.programs-sqlite;
}

View file

@ -0,0 +1,6 @@
{pkgs, ...}: {
environment.systemPackages = with pkgs; [
micro
prettyping
];
}

View file

@ -0,0 +1,6 @@
{
security.rtkit.enable = true;
nixpkgs.config.allowUnfree = true;
time.timeZone = "America/Toronto";
i18n.defaultLocale = "en_CA.UTF-8";
}

View file

@ -0,0 +1,6 @@
{
services.earlyoom = {
enable = true;
enableNotifications = true;
};
}

View file

@ -0,0 +1 @@
{nix.settings.experimental-features = ["nix-command" "flakes"];}

48
common.nix → modules/common/fish.nix Executable file → Normal file
View file

@ -1,30 +1,11 @@
{
pkgs,
self,
inputs,
...
}: {
# Shared configuration
programs = {
command-not-found.dbPath = "/etc/programs.sqlite";
fish.enable = true;
{pkgs, ...}: {
programs.fish = {
enable = true;
interactiveShellInit = "neofetch";
};
users = {
defaultUserShell = pkgs.fish;
users.quadradical = {
isNormalUser = true;
description = "QuadRadical";
extraGroups = ["networkmanager" "wheel" "wireshark" "libvirtd" "libvirt" "input" "kvm"];
};
};
environment = {
etc = {
"programs.sqlite".source = inputs.programsdb.packages.${pkgs.system}.programs-sqlite;
"backup".source = self;
};
systemPackages = [pkgs.hyfetch];
sessionVariables.fish_greeting = "";
shells = [pkgs.fish];
shellAliases = {
# Utility
@ -32,6 +13,7 @@
rm = "gio trash";
free = "free -h";
ping = "prettyping";
neofetch = "neowofetch";
shutdown = "shutdown now";
# Git
@ -52,20 +34,6 @@
config = "$EDITOR ~/.config/nixos/$(hostname)/configuration.nix";
home-manager = "$EDITOR ~/.config/nixos/$(hostname)/home-manager.nix";
};
systemPackages = with pkgs; [
micro
prettyping
];
};
documentation = {
info.enable = false;
nixos.enable = false;
};
security.rtkit.enable = true;
nixpkgs.config.allowUnfree = true;
time.timeZone = "America/Toronto";
i18n.defaultLocale = "en_CA.UTF-8";
nix.settings.experimental-features = ["nix-command" "flakes"];
users.defaultUserShell = pkgs.fish;
}

6
modules/common/micro.nix Normal file
View file

@ -0,0 +1,6 @@
{pkgs, ...}: {
environment = {
systemPackages = [pkgs.micro];
sessionVariables.EDITOR = "micro";
};
}

View file

@ -0,0 +1,6 @@
{
networking.networkmanager = {
enable = true;
wifi.macAddress = "random";
};
}

View file

@ -0,0 +1,6 @@
{
nix.settings = {
substituters = ["https://nix-gaming.cachix.org"];
trusted-public-keys = ["nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4="];
};
}

View file

@ -0,0 +1,7 @@
{
users.users.quadradical = {
isNormalUser = true;
description = "QuadRadical";
extraGroups = ["networkmanager" "wheel"];
};
}

View file

@ -0,0 +1,7 @@
{
documentation = {
doc.enable = false;
info.enable = false;
nixos.enable = false;
};
}

6
modules/common/zram.nix Normal file
View file

@ -0,0 +1,6 @@
{
zramSwap = {
enable = true;
memoryPercent = 100;
};
}

View file

@ -1,145 +1,4 @@
{
pkgs,
inputs,
nixpkgs,
...
}: {
boot = {
loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
plymouth.enable = true;
kernelPackages = pkgs.linuxPackages_zen;
kernelParams = ["sysrq_always_enabled=1"];
};
hardware.opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
};
networking = {
hostName = "quadraticpc";
networkmanager.enable = true;
};
nix.settings = {
substituters = ["https://nix-gaming.cachix.org"];
trusted-public-keys = ["nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4="];
};
nixpkgs.config.permittedInsecurePackages = [
"electron-24.8.6"
];
services = {
earlyoom = {
enable = true;
enableNotifications = true;
};
xserver = {
enable = true;
displayManager.gdm.enable = true;
desktopManager.gnome.enable = true;
layout = "us";
};
pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
lowLatency.enable = true;
};
avahi = {
enable = true;
nssmdns = true;
openFirewall = true;
};
gpm.enable = true;
printing.enable = true;
auto-cpufreq.enable = true;
};
environment = {
shellAliases = {
neofetch = "neowofetch";
};
sessionVariables = {
MANGOHUD = "1";
EDITOR = "micro";
VISUAL = "micro";
fish_greeting = "";
NIXOS_OZONE_WL = "1";
};
systemPackages = with pkgs; ([
fd
tldr
tuba
gimp
heroic
aspell
nodejs
ntfs3g
killall
ripgrep
hyfetch
inkscape
r2modman
pciutils
alejandra
grapejuice
impression
libreoffice
virt-manager
wl-clipboard
protontricks
android-studio
nodePackages.pnpm
hunspellDicts.en_CA-large
inputs.nix-gaming.packages.${system}.wine-ge
inputs.nixpkgs-local.legacyPackages.${system}.monophony
]
++ (with gnomeExtensions; [
caffeine
pop-shell
appindicator
search-light
blur-my-shell
just-perfection
burn-my-windows
fullscreen-avoider
compiz-windows-effect
]));
};
programs = {
steam = {
enable = true;
package = pkgs.steam.override {
extraProfile = "export STEAM_EXTRA_COMPAT_TOOLS_PATHS='${inputs.nix-gaming.packages.${pkgs.system}.proton-ge}'";
};
};
gamemode.enable = true;
noisetorch.enable = true;
fish.interactiveShellInit = "neofetch";
};
zramSwap = {
enable = true;
memoryPercent = 100;
};
system.stateVersion = "23.05";
sound.enable = true;
hardware.pulseaudio.enable = false;
virtualisation.libvirtd.enable = true;
networking.hostName = "quadraticpc";
}

View file

@ -1,166 +1,22 @@
{
pkgs,
inputs,
nixpkgs,
...
}: {
boot = {
loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
plymouth.enable = true;
kernelPackages = pkgs.linuxPackages_zen;
kernelParams = ["sysrq_always_enabled=1"];
};
hardware = {
opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
};
nvidia = {
prime = {
offload = {
enable = true;
enableOffloadCmd = true;
};
intelBusId = "PCI:00:02:0";
nvidiaBusId = "PCI:01:00:0";
hardware.nvidia = {
prime = {
offload = {
enable = true;
enableOffloadCmd = true;
};
open = false;
nvidiaSettings = false;
modesetting.enable = true;
nvidiaPersistenced = true;
dynamicBoost.enable = true;
intelBusId = "PCI:00:02:0";
nvidiaBusId = "PCI:01:00:0";
};
open = true;
nvidiaSettings = false;
modesetting.enable = true;
nvidiaPersistenced = true;
dynamicBoost.enable = true;
};
networking = {
hostName = "quadtop";
networkmanager.enable = true;
};
nix.settings = {
substituters = ["https://nix-gaming.cachix.org"];
trusted-public-keys = ["nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4="];
};
nixpkgs.config.permittedInsecurePackages = [
"electron-24.8.6"
];
services = {
earlyoom = {
enable = true;
enableNotifications = true;
};
xserver = {
enable = true;
displayManager.gdm.enable = true;
desktopManager.gnome.enable = true;
layout = "us";
videoDrivers = ["nvidia"];
};
pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
lowLatency.enable = true;
};
avahi = {
enable = true;
nssmdns = true;
openFirewall = true;
};
gpm.enable = true;
printing.enable = true;
auto-cpufreq.enable = true;
};
environment = {
shellAliases = {
neofetch = "neowofetch";
};
sessionVariables = {
MANGOHUD = "1";
EDITOR = "micro";
VISUAL = "micro";
fish_greeting = "";
NIXOS_OZONE_WL = "1";
GAMEMODERUNEXEC = "nvidia-offload";
};
systemPackages = with pkgs; ([
fd
tldr
tuba
gimp
heroic
aspell
nodejs
ntfs3g
killall
ripgrep
hyfetch
inkscape
r2modman
pciutils
alejandra
grapejuice
impression
libreoffice
virt-manager
wl-clipboard
protontricks
android-studio
nodePackages.pnpm
hunspellDicts.en_CA-large
inputs.nix-gaming.packages.${system}.wine-ge
inputs.nixpkgs-local.legacyPackages.${system}.monophony
]
++ (with gnomeExtensions; [
caffeine
pop-shell
appindicator
search-light
blur-my-shell
just-perfection
burn-my-windows
fullscreen-avoider
compiz-windows-effect
]));
};
programs = {
steam = {
enable = true;
package = pkgs.steam.override {
extraProfile = "export STEAM_EXTRA_COMPAT_TOOLS_PATHS='${inputs.nix-gaming.packages.${pkgs.system}.proton-ge}'";
};
};
gamemode.enable = true;
noisetorch.enable = true;
fish.interactiveShellInit = "neofetch";
};
zramSwap = {
enable = true;
memoryPercent = 100;
};
system.stateVersion = "23.05";
sound.enable = true;
hardware.pulseaudio.enable = false;
services.xserver.videoDrivers = ["nvidia"];
virtualisation.libvirtd.enable = true;
networking.hostName = "quadtop";
}

View file

@ -1,28 +1,27 @@
{inputs, ...}: {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = {inherit inputs;};
home-manager.users.quadradical = {
home = {
username = "quadradical";
homeDirectory = "/home/quadradical";
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = {inherit inputs;};
users.quadradical = {
home = {
username = "quadradical";
homeDirectory = "/home/quadradical";
};
};
sharedModules = [
{home.stateVersion = "23.11";}
../home-manager/gtk.nix
../home-manager/bat.nix
../home-manager/eza.nix
../home-manager/git.nix
../home-manager/btop.nix
../home-manager/vscode.nix
../home-manager/direnv.nix
../home-manager/firefox.nix
../home-manager/neofetch.nix
../home-manager/mangohud.nix
../home-manager/sway.nix
];
};
home-manager.sharedModules = [
{
programs.home-manager.enable = true;
home.stateVersion = "23.11";
}
../home-manager/gtk.nix
../home-manager/bat.nix
../home-manager/eza.nix
../home-manager/git.nix
../home-manager/btop.nix
../home-manager/vscode.nix
../home-manager/direnv.nix
../home-manager/firefox.nix
../home-manager/neofetch.nix
../home-manager/mangohud.nix
../home-manager/sway.nix
];
}