This commit is contained in:
Mira 2024-07-03 12:58:48 -04:00
parent baca79adc7
commit 393bda608b
4 changed files with 184 additions and 85 deletions

View file

@ -1,21 +1,25 @@
# Edit this configuration file to define what should be installed on # Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page, on # your system. Help is available in the configuration.nix(5) man page, on
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`). # https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
{ config, lib, pkgs, ... }:
{ {
imports = config,
[ # Include the results of the hardware scan. lib,
pkgs,
...
}: {
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
]; ];
# nix = { nix = {
# package = pkgs.nixFlakes; package = pkgs.nixFlakes;
# extraOptions = '' optimise.automatic = true;
# experimental-features = nix-command flakes gc.automatic = true;
# ''; extraOptions = ''
# }; experimental-features = nix-command flakes
'';
};
# Use the systemd-boot EFI boot loader. # Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;
@ -63,6 +67,8 @@
# BTRFS scrub # BTRFS scrub
services.btrfs.autoScrub.enable = true; services.btrfs.autoScrub.enable = true;
services.avahi.enable = true;
# Configure keymap in X11 # Configure keymap in X11
# services.xserver.xkb.layout = "us"; # services.xserver.xkb.layout = "us";
# services.xserver.xkb.options = "eurosign:e,caps:escape"; # services.xserver.xkb.options = "eurosign:e,caps:escape";
@ -105,29 +111,42 @@
# List packages installed in system profile. To search, run: # List packages installed in system profile. To search, run:
# $ nix search wget # $ nix search wget
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
go
alejandra
alacritty alacritty
bat bat
btdu btdu
chezmoi
btop btop
btrbk btrbk
cargo
czkawka czkawka
docker docker
file
fzf fzf
gcc
git
fastfetch
hyfetch hyfetch
hyperfine hyperfine
jellyfin-media-player jellyfin-media-player
lazydocker lazydocker
lazygit lazygit
git
lsd lsd
mcfly mcfly
neovim neovim
nodePackages.pnpm
nodePackages.nodejs
kodiPackages.jellyfin
kodiPackages.steam-controller
sheldon sheldon
starship starship
tmux tmux
viddy viddy
wget wget
zoxide
zsh zsh
nil
]; ];
# Some programs need SUID wrappers, can be configured further or are # Some programs need SUID wrappers, can be configured further or are
@ -140,6 +159,16 @@
programs.zsh.enable = true; programs.zsh.enable = true;
programs.neovim = {
enable = true;
configure = {
customRC = ''
set number relativenumber
'';
};
defaultEditor = true;
};
# programs.zoxide = { # programs.zoxide = {
# enable = true; # enable = true;
# enableBashIntegration = true; # enableBashIntegration = true;
@ -170,7 +199,6 @@
PermitRootLogin = "prohibit-password"; PermitRootLogin = "prohibit-password";
PasswordAuthentication = false; PasswordAuthentication = false;
}; };
}; };
virtualisation.docker = { virtualisation.docker = {
@ -184,12 +212,30 @@
# networking.firewall.allowedTCPPorts = [ ... ]; # networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ]; # networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether. # Or disable the firewall altogether.
# networking.firewall.enable = false; networking.firewall = {
enable = false;
};
systemd.timers."qbittorrent-healthcheck" = {
wantedBy = ["timers.target"];
timerConfig = {
OnCalendar = "*/5 * * * *";
Unit = "qbittorrent-healthcheck";
};
};
systemd.services."qbittorrent-healthcheck" = {
script = ''
${pkgs.docker} exec qbittorrent ping -c 1 -w 5 -I protonwire0 8.8.8.8 || ${pkgs.docker} restart qbittorrent
'';
serviceConfig = {
Type = "oneshot";
User = "root";
};
};
# Copy the NixOS configuration file and link it from the resulting system # Copy the NixOS configuration file and link it from the resulting system
# (/run/current-system/configuration.nix). This is useful in case you # (/run/current-system/configuration.nix). This is useful in case you
# accidentally delete configuration.nix. # accidentally delete configuration.nix.
system.copySystemConfiguration = true; # system.copySystemConfiguration = true;
# This option defines the first version of NixOS you have installed on this particular machine, # This option defines the first version of NixOS you have installed on this particular machine,
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions. # and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
@ -208,6 +254,4 @@
# #
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion . # For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
system.stateVersion = "23.11"; # Did you read the comment? system.stateVersion = "23.11"; # Did you read the comment?
} }

27
flake.lock generated Normal file
View file

@ -0,0 +1,27 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1710272261,
"narHash": "sha256-g0bDwXFmTE7uGDOs9HcJsfLFhH7fOsASbAuOzDC+fhQ=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "0ad13a6833440b8e238947e47bea7f11071dc2b2",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

24
flake.nix Normal file
View file

@ -0,0 +1,24 @@
# /etc/nixos/flake.nix
{
description = "flake for mira::auxin";
inputs = {
nixpkgs = {
url = "github:NixOS/nixpkgs/nixos-unstable";
};
};
outputs = {
self,
nixpkgs,
}: {
nixosConfigurations = {
auxin = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./configuration.nix
];
};
};
};
}

View file

@ -1,11 +1,15 @@
# 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" "usb_storage" "usbhid" "sd_mod"]; boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod"];
@ -13,38 +17,38 @@
boot.kernelModules = ["kvm-intel"]; boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = []; boot.extraModulePackages = [];
fileSystems."/" = fileSystems."/" = {
{ device = "/dev/disk/by-uuid/b6931dc5-1ccb-4d81-abf6-38b6febc6176"; device = "/dev/disk/by-uuid/b6931dc5-1ccb-4d81-abf6-38b6febc6176";
fsType = "btrfs"; fsType = "btrfs";
options = ["subvol=@nixos" "noatime"]; options = ["subvol=@nixos" "noatime"];
}; };
fileSystems."/nix" = fileSystems."/nix" = {
{ device = "/dev/disk/by-uuid/b6931dc5-1ccb-4d81-abf6-38b6febc6176"; device = "/dev/disk/by-uuid/b6931dc5-1ccb-4d81-abf6-38b6febc6176";
fsType = "btrfs"; fsType = "btrfs";
options = ["subvol=@nix" "noatime"]; options = ["subvol=@nix" "noatime"];
}; };
fileSystems."/home" = fileSystems."/home" = {
{ device = "/dev/disk/by-uuid/b6931dc5-1ccb-4d81-abf6-38b6febc6176"; device = "/dev/disk/by-uuid/b6931dc5-1ccb-4d81-abf6-38b6febc6176";
fsType = "btrfs"; fsType = "btrfs";
options = ["subvol=@home" "noatime" "compress=zstd"]; options = ["subvol=@home" "noatime" "compress=zstd"];
}; };
fileSystems."/swap" = fileSystems."/swap" = {
{ device = "/dev/disk/by-uuid/b6931dc5-1ccb-4d81-abf6-38b6febc6176"; device = "/dev/disk/by-uuid/b6931dc5-1ccb-4d81-abf6-38b6febc6176";
fsType = "btrfs"; fsType = "btrfs";
options = ["subvol=@swap"]; options = ["subvol=@swap"];
}; };
fileSystems."/boot" = fileSystems."/boot" = {
{ device = "/dev/disk/by-uuid/34E4-E112"; device = "/dev/disk/by-uuid/34E4-E112";
fsType = "vfat"; fsType = "vfat";
}; };
fileSystems."/raid" = fileSystems."/raid" = {
{ device = "/dev/sdb1"; device = "/dev/sdb1";
fsType = "btrfs"; fsType = "btrfs";
# options = [ "noatime" "noauto" "x-systemd.automount" "nofail" "space_cache=v2" "compress=zstd"]; options = ["noatime" "noauto" "x-systemd.automount" "nofail" "space_cache=v2" "compress=zstd"];
}; };
# swapDevices = [ "/swap/swapfile" ]; # swapDevices = [ "/swap/swapfile" ];