first commit
This commit is contained in:
commit
f1c5038fd7
15 changed files with 2481 additions and 0 deletions
193
systems/x86_64-linux/navis/default.nix
Normal file
193
systems/x86_64-linux/navis/default.nix
Normal file
|
@ -0,0 +1,193 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
with pkgs; {
|
||||
imports = [./hardware.nix];
|
||||
|
||||
age = {
|
||||
secrets.passwd.file = /etc/secrets/passwd.age;
|
||||
identityPaths = [
|
||||
"/persist/root/.ssh/id_ed25519"
|
||||
];
|
||||
};
|
||||
|
||||
chaotic = {
|
||||
scx = {
|
||||
enable = true;
|
||||
scheduler = "scx_rusty";
|
||||
};
|
||||
|
||||
steam.extraCompatPackages = [
|
||||
luxtorpeda
|
||||
proton-ge-custom
|
||||
];
|
||||
};
|
||||
|
||||
virtualisation.podman.enable = true;
|
||||
virtualisation.podman.enableNvidia = true;
|
||||
|
||||
environment = {
|
||||
sessionVariables = {
|
||||
NIXOS_OZONE_WL = "1";
|
||||
EDITOR = "nvim";
|
||||
};
|
||||
|
||||
systemPackages =
|
||||
[
|
||||
kde-rounded-corners
|
||||
]
|
||||
++ (with inputs; [
|
||||
agenix.packages.${system}.default
|
||||
kwin-effects-forceblur.packages.${system}.default
|
||||
]);
|
||||
|
||||
persistence."/persist" = {
|
||||
hideMounts = true;
|
||||
directories = [
|
||||
"/root/.ssh"
|
||||
"/etc/secrets"
|
||||
"/etc/ssh"
|
||||
"/var/lib/bluetooth"
|
||||
"/var/lib/nixos"
|
||||
"/var/lib/systemd/coredump"
|
||||
"/etc/NetworkManager/system-connections"
|
||||
{
|
||||
directory = "/var/lib/colord";
|
||||
user = "colord";
|
||||
group = "colord";
|
||||
mode = "u=rwx,g=rx,o=";
|
||||
}
|
||||
];
|
||||
files = [
|
||||
"/etc/machine-id"
|
||||
{
|
||||
file = "/var/keys/secret_file";
|
||||
parentDirectory = {mode = "u=rwx,g=,o=";};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
boot = {
|
||||
#initrd.systemd.enable = true;
|
||||
#plymouth.enable = true;
|
||||
|
||||
blacklistedKernelModules = ["i915"];
|
||||
kernelPackages = linuxPackages_cachyos;
|
||||
kernelParams = ["module_blacklist=i915" "quiet"];
|
||||
supportedFilesystems = ["btrfs" "ntfs"];
|
||||
|
||||
loader = {
|
||||
systemd-boot.enable = true;
|
||||
efi.canTouchEfiVariables = true;
|
||||
};
|
||||
};
|
||||
|
||||
nix = {
|
||||
package = nixVersions.git;
|
||||
|
||||
settings = {
|
||||
trusted-users = ["marshall"];
|
||||
substituters = [
|
||||
"https://cache.nixos.org"
|
||||
"https://nix-community.cachix.org"
|
||||
"https://cache.iog.io"
|
||||
"https://nyx.chaotic.cx/"
|
||||
];
|
||||
|
||||
trusted-substituters = [
|
||||
"cache.nixos.org"
|
||||
"nix-community.cachix.org"
|
||||
"cache.iog.io"
|
||||
"nyx.chaotic.cx"
|
||||
];
|
||||
|
||||
trusted-public-keys = [
|
||||
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
|
||||
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||
"hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ="
|
||||
"nyx.chaotic.cx-1:HfnXSw4pj95iI/n17rIDy40agHj12WfF+Gqk6SonIT8="
|
||||
"chaotic-nyx.cachix.org-1:HfnXSw4pj95iI/n17rIDy40agHj12WfF+Gqk6SonIT8="
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
programs = {
|
||||
fish.enable = true;
|
||||
gamemode.enable = true;
|
||||
steam.enable = true;
|
||||
gnupg.agent.enable = true;
|
||||
|
||||
nh = {
|
||||
enable = true;
|
||||
clean.enable = true;
|
||||
clean.extraArgs = "--keep-since 4d --keep 3";
|
||||
flake = "/home/marshall/nix-config";
|
||||
};
|
||||
};
|
||||
|
||||
networking = {
|
||||
hostName = "navis";
|
||||
networkmanager.enable = true;
|
||||
firewall.enable = false;
|
||||
};
|
||||
|
||||
time.timeZone = "America/New_York";
|
||||
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
|
||||
services = {
|
||||
btrfs.autoScrub.enable = true;
|
||||
desktopManager.plasma6.enable = true;
|
||||
displayManager.sddm.enable = true;
|
||||
flatpak.enable = true;
|
||||
libinput.enable = true;
|
||||
libinput.touchpad.naturalScrolling = true;
|
||||
openssh.enable = true;
|
||||
|
||||
xserver = {
|
||||
enable = true;
|
||||
videoDrivers = ["nvidia"];
|
||||
xkb.layout = "us";
|
||||
};
|
||||
|
||||
pipewire = {
|
||||
enable = true;
|
||||
pulse.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
users = {
|
||||
mutableUsers = false;
|
||||
|
||||
users.marshall = {
|
||||
isNormalUser = true;
|
||||
extraGroups = ["wheel" "gamemode"];
|
||||
shell = fish;
|
||||
hashedPasswordFile = config.age.secrets.passwd.path;
|
||||
packages = [
|
||||
firefox
|
||||
neovim
|
||||
telegram-desktop
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
hardware = {
|
||||
opengl = {
|
||||
enable = true;
|
||||
driSupport = true;
|
||||
driSupport32Bit = true;
|
||||
};
|
||||
|
||||
nvidia = {
|
||||
package = config.boot.kernelPackages.nvidiaPackages.latest;
|
||||
modesetting.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
system.stateVersion = "24.05";
|
||||
}
|
90
systems/x86_64-linux/navis/hardware.nix
Normal file
90
systems/x86_64-linux/navis/hardware.nix
Normal file
|
@ -0,0 +1,90 @@
|
|||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
modulesPath,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = ["xhci_pci" "nvme" "usbhid" "usb_storage" "sd_mod"];
|
||||
boot.initrd.kernelModules = [];
|
||||
boot.kernelModules = ["kvm-intel"];
|
||||
boot.extraModulePackages = [];
|
||||
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-uuid/d375c3a3-63a3-47f8-8b77-58fabbb8f67b";
|
||||
fsType = "btrfs";
|
||||
options = ["subvol=root"];
|
||||
};
|
||||
|
||||
boot.initrd.postDeviceCommands = lib.mkAfter ''
|
||||
mkdir /btrfs_tmp
|
||||
mount /dev/disk/by-uuid/d375c3a3-63a3-47f8-8b77-58fabbb8f67b /btrfs_tmp
|
||||
if [[ -e /btrfs_tmp/root ]]; then
|
||||
mkdir -p /btrfs_tmp/old_roots
|
||||
timestamp=$(date --date="@$(stat -c %Y /btrfs_tmp/root)" "+%Y-%m-%-d_%H:%M:%S")
|
||||
mv /btrfs_tmp/root "/btrfs_tmp/old_roots/$timestamp"
|
||||
fi
|
||||
|
||||
delete_subvolume_recursively() {
|
||||
IFS=$'\n'
|
||||
for i in $(btrfs subvolume list -o "$1" | cut -f 9- -d ' '); do
|
||||
delete_subvolume_recursively "/btrfs_tmp/$i"
|
||||
done
|
||||
btrfs subvolume delete "$1"
|
||||
}
|
||||
|
||||
for i in $(find /btrfs_tmp/old_roots/ -maxdepth 1 -mtime +30); do
|
||||
delete_subvolume_recursively "$i"
|
||||
done
|
||||
|
||||
btrfs subvolume create /btrfs_tmp/root
|
||||
umount /btrfs_tmp
|
||||
'';
|
||||
|
||||
boot.initrd.luks.devices."enc".device = "/dev/disk/by-uuid/9952fcd1-46eb-4c9c-ab7d-361d31fdb9a2";
|
||||
|
||||
fileSystems."/home" = {
|
||||
device = "/dev/disk/by-uuid/d375c3a3-63a3-47f8-8b77-58fabbb8f67b";
|
||||
fsType = "btrfs";
|
||||
options = ["subvol=home" "compress=zstd"];
|
||||
};
|
||||
|
||||
fileSystems."/nix" = {
|
||||
device = "/dev/disk/by-uuid/d375c3a3-63a3-47f8-8b77-58fabbb8f67b";
|
||||
fsType = "btrfs";
|
||||
options = ["subvol=nix" "compress=zstd" "noatime"];
|
||||
};
|
||||
|
||||
fileSystems."/persist" = {
|
||||
device = "/dev/disk/by-uuid/d375c3a3-63a3-47f8-8b77-58fabbb8f67b";
|
||||
neededForBoot = true;
|
||||
fsType = "btrfs";
|
||||
options = ["subvol=persist" "compress=zstd"];
|
||||
};
|
||||
|
||||
fileSystems."/var/log" = {
|
||||
device = "/dev/disk/by-uuid/d375c3a3-63a3-47f8-8b77-58fabbb8f67b";
|
||||
fsType = "btrfs";
|
||||
options = ["subvol=log" "compress=zstd" "noatime"];
|
||||
neededForBoot = true;
|
||||
};
|
||||
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-uuid/12CE-A600";
|
||||
fsType = "vfat";
|
||||
options = ["fmask=0022" "dmask=0022"];
|
||||
};
|
||||
|
||||
swapDevices = [];
|
||||
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue