formatting

This commit is contained in:
caandt 2024-10-27 12:34:49 -05:00
parent 6d04251eb7
commit e6f2aa347e
24 changed files with 152 additions and 145 deletions

View file

@ -14,12 +14,19 @@
}; };
}; };
outputs = { nixpkgs, nixpkgs-stable, home-manager, flake-programs-sqlite, ... }@inputs: outputs = {
let nixpkgs,
system = "x86_64-linux"; nixpkgs-stable,
pkgs = nixpkgs.legacyPackages.${system}; home-manager,
pkgs-stable = nixpkgs-stable.legacyPackages.${system}; flake-programs-sqlite,
in with builtins; with nixpkgs.lib.attrsets; { ...
} @ inputs: let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
pkgs-stable = nixpkgs-stable.legacyPackages.${system};
in
with builtins;
with nixpkgs.lib.attrsets; {
nixosConfigurations = mapAttrs' (host: _: { nixosConfigurations = mapAttrs' (host: _: {
name = host; name = host;
value = nixpkgs.lib.nixosSystem { value = nixpkgs.lib.nixosSystem {
@ -28,20 +35,25 @@
inherit pkgs-stable; inherit pkgs-stable;
inherit flake-programs-sqlite; inherit flake-programs-sqlite;
}; };
modules = [ (./hosts + "/${host}") ]; modules = [(./hosts + "/${host}")];
}; };
}) (readDir ./hosts); }) (readDir ./hosts);
homeConfigurations = foldl' (a: b: a//b) {} (map (host: let users = ./hosts + "/${host}/users"; in homeConfigurations = foldl' (a: b: a // b) {} (map (
if pathExists users host: let
then mapAttrs' (user: _: { users = ./hosts + "/${host}/users";
name = "${user}@${host}"; in
value = home-manager.lib.homeManagerConfiguration { if pathExists users
inherit pkgs; then
extraSpecialArgs = { mapAttrs' (user: _: {
inherit pkgs-stable; name = "${user}@${host}";
value = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
extraSpecialArgs = {
inherit pkgs-stable;
};
modules = [(users + "/${user}")];
}; };
modules = [ (users + "/${user}") ]; }) (readDir users)
};}) (readDir users)
else {} else {}
) (attrNames (readDir ./hosts))); ) (attrNames (readDir ./hosts)));
}; };

View file

@ -1,6 +1,4 @@
{ ... }: {...}: {
{
imports = [ imports = [
../../system ../../system
./hardware-configuration.nix ./hardware-configuration.nix
@ -9,7 +7,7 @@
networking.hostName = "hyuganatsu"; networking.hostName = "hyuganatsu";
time.timeZone = "America/Chicago"; time.timeZone = "America/Chicago";
services.xserver = { services.xserver = {
videoDrivers = [ "amdgpu" ]; videoDrivers = ["amdgpu"];
deviceSection = ''Option "TearFree" "true"''; deviceSection = ''Option "TearFree" "true"'';
}; };
} }

View file

@ -1,29 +1,33 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{ {
imports = config,
[ (modulesPath + "/installer/scan/not-detected.nix") lib,
]; pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod"];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [];
boot.kernelModules = [ "kvm-amd" ]; boot.kernelModules = ["kvm-amd"];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [];
fileSystems."/" = fileSystems."/" = {
{ device = "/dev/disk/by-uuid/37229430-3b89-413e-9f9d-f36b3d2935bf"; device = "/dev/disk/by-uuid/37229430-3b89-413e-9f9d-f36b3d2935bf";
fsType = "ext4"; fsType = "ext4";
}; };
fileSystems."/boot" = fileSystems."/boot" = {
{ device = "/dev/disk/by-uuid/1FF4-8F2A"; device = "/dev/disk/by-uuid/1FF4-8F2A";
fsType = "vfat"; fsType = "vfat";
}; };
swapDevices = [ ]; swapDevices = [];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking # Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's # (the default) this is the recommended approach. When using systemd-networkd it's

View file

@ -1,6 +1,4 @@
{ config, ... }: {config, ...}: {
{
imports = [ imports = [
../../../../user ../../../../user
]; ];

View file

@ -1,6 +1,4 @@
{ lib, ... }: {lib, ...}: {
{
imports = [ imports = [
../common ../common
./hardware-configuration.nix ./hardware-configuration.nix
@ -9,7 +7,7 @@
networking.hostName = "iyokan"; networking.hostName = "iyokan";
time.timeZone = "America/Chicago"; time.timeZone = "America/Chicago";
services.xserver = { services.xserver = {
videoDrivers = [ "nvidia" ]; videoDrivers = ["nvidia"];
deviceSection = ''Option "TearFree" "true"''; deviceSection = ''Option "TearFree" "true"'';
}; };
hardware.nvidia.open = false; hardware.nvidia.open = false;

View file

@ -1,37 +1,41 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{ {
imports = config,
[ (modulesPath + "/installer/scan/not-detected.nix") lib,
]; pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "sd_mod" ]; boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid" "sd_mod"];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [];
boot.kernelModules = [ "kvm-intel" ]; boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [];
fileSystems."/" = fileSystems."/" = {
{ device = "/dev/disk/by-uuid/6c86675c-7428-4a34-98e2-7fa2b423b53e"; device = "/dev/disk/by-uuid/6c86675c-7428-4a34-98e2-7fa2b423b53e";
fsType = "ext4"; fsType = "ext4";
}; };
fileSystems."/home" = fileSystems."/home" = {
{ device = "/dev/disk/by-uuid/d376771f-3dd5-4d8a-94d3-dcb75aae146d"; device = "/dev/disk/by-uuid/d376771f-3dd5-4d8a-94d3-dcb75aae146d";
fsType = "ext4"; fsType = "ext4";
}; };
fileSystems."/boot" = fileSystems."/boot" = {
{ device = "/dev/disk/by-uuid/4F3D-4702"; device = "/dev/disk/by-uuid/4F3D-4702";
fsType = "vfat"; fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ]; options = ["fmask=0022" "dmask=0022"];
}; };
swapDevices = swapDevices = [
[ { device = "/dev/disk/by-uuid/8049404d-f5fb-4387-bb75-f308a7f7126f"; } {device = "/dev/disk/by-uuid/8049404d-f5fb-4387-bb75-f308a7f7126f";}
]; ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking # Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's # (the default) this is the recommended approach. When using systemd-networkd it's

View file

@ -1,6 +1,4 @@
{ ... }: {...}: {
{
services.pipewire = { services.pipewire = {
enable = true; enable = true;
alsa.enable = true; alsa.enable = true;

View file

@ -1,6 +1,4 @@
{ lib, ... }: {lib, ...}: {
{
programs.bash = { programs.bash = {
completion.enable = true; completion.enable = true;
promptInit = ''PS1="[\u \W] \[\e[32;1m\]\$\[\e[0m\] "''; promptInit = ''PS1="[\u \W] \[\e[32;1m\]\$\[\e[0m\] "'';

View file

@ -1,6 +1,4 @@
{ ... }: {...}: {
{
boot.loader = { boot.loader = {
grub.enable = true; grub.enable = true;
grub.device = "nodev"; grub.device = "nodev";

View file

@ -1,12 +1,16 @@
{ config, pkgs, lib, flake-programs-sqlite, ... }:
{ {
config,
pkgs,
lib,
flake-programs-sqlite,
...
}: {
nix.settings = { nix.settings = {
experimental-features = [ "nix-command" "flakes" ]; experimental-features = ["nix-command" "flakes"];
use-xdg-base-directories = true; use-xdg-base-directories = true;
}; };
environment.pathsToLink = [ "/libexec" ]; environment.pathsToLink = ["/libexec"];
environment.localBinInPath = true; environment.localBinInPath = true;
boot.tmp.useTmpfs = true; boot.tmp.useTmpfs = true;
@ -29,11 +33,10 @@
xdg.terminal-exec = { xdg.terminal-exec = {
enable = true; enable = true;
settings.default = [ "Alacritty.desktop" ]; settings.default = ["Alacritty.desktop"];
}; };
programs.command-not-found.dbPath = flake-programs-sqlite.packages.${pkgs.system}.programs-sqlite; programs.command-not-found.dbPath = flake-programs-sqlite.packages.${pkgs.system}.programs-sqlite;
system.stateVersion = "24.05"; system.stateVersion = "24.05";
} }

View file

@ -1,6 +1,4 @@
{ ... }: {...}: {
{
imports = [ imports = [
./audio.nix ./audio.nix
./bash.nix ./bash.nix

View file

@ -1,6 +1,4 @@
{ ... }: {...}: {
{
services.xserver = { services.xserver = {
enable = true; enable = true;
autorun = false; autorun = false;

View file

@ -1,6 +1,4 @@
{ pkgs, ... }: {pkgs, ...}: {
{
i18n.defaultLocale = "en_US.UTF-8"; i18n.defaultLocale = "en_US.UTF-8";
i18n.supportedLocales = [ i18n.supportedLocales = [
"en_US.UTF-8/UTF-8" "en_US.UTF-8/UTF-8"
@ -19,6 +17,6 @@
noto-fonts-cjk-sans noto-fonts-cjk-sans
source-han-sans source-han-sans
source-han-serif source-han-serif
(nerdfonts.override { fonts = [ "JetBrainsMono" ]; }) (nerdfonts.override {fonts = ["JetBrainsMono"];})
]; ];
} }

View file

@ -1,6 +1,4 @@
{ pkgs, ... }: {pkgs, ...}: {
{
programs.partition-manager = { programs.partition-manager = {
enable = true; enable = true;
package = pkgs.libsForQt5.partitionmanager; package = pkgs.libsForQt5.partitionmanager;

View file

@ -1,10 +1,11 @@
{ ... }: {...}: {
{
security.doas = { security.doas = {
enable = true; enable = true;
extraRules = [ extraRules = [
{ groups = [ "wheel" ]; persist = true; } {
groups = ["wheel"];
persist = true;
}
]; ];
}; };
security.polkit.enable = true; security.polkit.enable = true;

View file

@ -1,8 +1,6 @@
{ ... }: {...}: {
{
users.users.ahnwuoa = { users.users.ahnwuoa = {
isNormalUser = true; isNormalUser = true;
extraGroups = [ "wheel" "podman" ]; extraGroups = ["wheel" "podman"];
}; };
} }

View file

@ -1,6 +1,4 @@
{ ... }: {...}: {
{
virtualisation.containers.enable = true; virtualisation.containers.enable = true;
virtualisation = { virtualisation = {
podman = { podman = {

View file

@ -1,19 +1,23 @@
{ config, pkgs, ... }: {
config,
let pkgs,
...
}: let
deps = { deps = {
bell = [ pkgs.pipewire pkgs.libnotify ]; bell = [pkgs.pipewire pkgs.libnotify];
nsxiv-rifle = [ pkgs.nsxiv ]; nsxiv-rifle = [pkgs.nsxiv];
screenshot = [ pkgs.maim pkgs.xclip ]; screenshot = [pkgs.maim pkgs.xclip];
}; };
mkln = x: config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.local/nixos/user/bin/${x}"; mkln = x: config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.local/nixos/user/bin/${x}";
in { in {
home.file = builtins.listToAttrs (map home.file = builtins.listToAttrs (
map
(x: { (x: {
name = ".local/bin/${x}"; name = ".local/bin/${x}";
value = { source = mkln x; }; value = {source = mkln x;};
}) })
(builtins.filter (
builtins.filter
(x: x != "default.nix") (x: x != "default.nix")
(builtins.attrNames (builtins.readDir ./.)) (builtins.attrNames (builtins.readDir ./.))
) )

View file

@ -1,6 +1,4 @@
{ ... }: {...}: {
{
imports = [ imports = [
./bin ./bin
./home.nix ./home.nix

View file

@ -1,11 +1,14 @@
{ config, pkgs, pkgs-stable, ... }:
{ {
config,
pkgs,
pkgs-stable,
...
}: {
home.packages = with pkgs; [ home.packages = with pkgs; [
(pkgs.symlinkJoin { (pkgs.symlinkJoin {
name = "firefox"; name = "firefox";
paths = [ pkgs-stable.firefox ]; paths = [pkgs-stable.firefox];
buildInputs = [ pkgs.makeWrapper ]; buildInputs = [pkgs.makeWrapper];
postBuild = '' postBuild = ''
wrapProgram $out/bin/firefox \ wrapProgram $out/bin/firefox \
--set HOME "${config.home.homeDirectory}/.local/share" --set HOME "${config.home.homeDirectory}/.local/share"
@ -72,7 +75,7 @@
gdb gdb
pwndbg pwndbg
(pkgs-stable.cutter.withPlugins (ps: with ps; [ jsdec rz-ghidra sigdb ])) (pkgs-stable.cutter.withPlugins (ps: with ps; [jsdec rz-ghidra sigdb]))
ghidra-bin ghidra-bin
pwninit pwninit
patchelf patchelf

View file

@ -1,6 +1,4 @@
{ ... }: {...}: {
{
imports = [ imports = [
./nsxiv-rifle.nix ./nsxiv-rifle.nix
]; ];

View file

@ -1,6 +1,4 @@
{ ... }: {...}: {
{
xdg.desktopEntries."nsxiv-rifle" = { xdg.desktopEntries."nsxiv-rifle" = {
exec = "nsxiv-rifle %F"; exec = "nsxiv-rifle %F";
icon = "nsxiv"; icon = "nsxiv";

View file

@ -1,6 +1,8 @@
{ config, pkgs, ... }:
{ {
config,
pkgs,
...
}: {
qt = { qt = {
enable = true; enable = true;
platformTheme.name = "qtct"; platformTheme.name = "qtct";
@ -10,7 +12,7 @@
gtk = { gtk = {
enable = true; enable = true;
gtk2.extraConfig = "gtk-recent-files-max-age = 0"; gtk2.extraConfig = "gtk-recent-files-max-age = 0";
gtk3.extraConfig = { gtk-recent-files-limit = 0; }; gtk3.extraConfig = {gtk-recent-files-limit = 0;};
theme = { theme = {
name = "Breeze"; name = "Breeze";
package = pkgs.libsForQt5.breeze-gtk; package = pkgs.libsForQt5.breeze-gtk;

View file

@ -1,6 +1,8 @@
{ config, pkgs, ... }: {
config,
let pkgs,
...
}: let
mkln = x: config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.local/nixos/user/${x}"; mkln = x: config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.local/nixos/user/${x}";
in { in {
xdg.configFile.alacritty.source = mkln "config/alacritty"; xdg.configFile.alacritty.source = mkln "config/alacritty";
@ -22,10 +24,12 @@ in {
xdg.configFile.readline.source = config/readline; xdg.configFile.readline.source = config/readline;
xdg.configFile."starship.toml".source = config/starship.toml; xdg.configFile."starship.toml".source = config/starship.toml;
xdg.configFile.sx.source = mkln "config/sx"; xdg.configFile.sx.source = mkln "config/sx";
xdg.configFile."tmux/tmux.conf".text = (builtins.readFile config/tmux/tmux.conf) + '' xdg.configFile."tmux/tmux.conf".text =
run ${pkgs.tmuxPlugins.vim-tmux-navigator.rtp} (builtins.readFile config/tmux/tmux.conf)
run ${pkgs.tmuxPlugins.sessionist.rtp} + ''
''; run ${pkgs.tmuxPlugins.vim-tmux-navigator.rtp}
run ${pkgs.tmuxPlugins.sessionist.rtp}
'';
fonts.fontconfig.enable = false; fonts.fontconfig.enable = false;
gtk.gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc"; gtk.gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc";
xdg.mimeApps.enable = true; xdg.mimeApps.enable = true;
@ -52,8 +56,8 @@ in {
}; };
xdg.portal = { xdg.portal = {
enable = true; enable = true;
configPackages = [ pkgs.libsForQt5.xdg-desktop-portal-kde ]; configPackages = [pkgs.libsForQt5.xdg-desktop-portal-kde];
extraPortals = [ pkgs.libsForQt5.xdg-desktop-portal-kde ]; extraPortals = [pkgs.libsForQt5.xdg-desktop-portal-kde];
config.common.default = "kde"; config.common.default = "kde";
}; };
} }