should prob push this

This commit is contained in:
Mars 2024-09-28 22:03:51 -04:00
parent fefde6933f
commit 479e93469e
Signed by: pupbrained
GPG key ID: 0FF5B8826803F895
9 changed files with 585 additions and 310 deletions

View file

@ -4,9 +4,10 @@
inputs,
lib,
...
}:
with lib // pkgs // inputs; {
imports = [./hardware.nix];
}: {
imports = [
./hardware.nix
];
security = {
rtkit.enable = true;
@ -30,7 +31,11 @@ with lib // pkgs // inputs; {
];
};
sudo.wheelNeedsPassword = false;
sudo-rs = {
enable = true;
wheelNeedsPassword = false;
execWheelOnly = true;
};
};
console.catppuccin.enable = true;
@ -40,7 +45,7 @@ with lib // pkgs // inputs; {
];
systemd.user.extraConfig = let
path = concatStringsSep ":" [
path = lib.concatStringsSep ":" [
"/run/wrappers/bin"
"/etc/profiles/per-user/%u/bin"
"/nix/var/nix/profiles/default/bin"
@ -51,7 +56,7 @@ with lib // pkgs // inputs; {
'';
age = {
secrets.passwd.file = "${self}/secrets/passwd.age";
secrets.passwd.file = ../../../secrets/passwd.age;
identityPaths = ["/persist/root/.ssh/id_ed25519"];
};
@ -60,11 +65,6 @@ with lib // pkgs // inputs; {
enable = true;
scheduler = "scx_rusty";
};
steam.extraCompatPackages = [
luxtorpeda
proton-ge-custom
];
};
virtualisation = {
@ -77,11 +77,11 @@ with lib // pkgs // inputs; {
onShutdown = "shutdown";
qemu = {
package = qemu_kvm;
package = pkgs.qemu_kvm;
swtpm.enable = true;
runAsRoot = false;
ovmf.enable = true;
ovmf.packages = [OVMFFull.fd];
ovmf.packages = [pkgs.OVMFFull.fd];
};
};
@ -100,8 +100,8 @@ with lib // pkgs // inputs; {
TERMINAL = "wezterm";
};
systemPackages = [
agenix.packages.${system}.default
systemPackages = with pkgs; [
inputs.agenix.packages.${system}.default
nautilus
internal.lightly-boehs-qt6
looking-glass-client
@ -132,13 +132,13 @@ with lib // pkgs // inputs; {
boot = {
blacklistedKernelModules = ["nouveau" "i915"];
kernelPackages = linuxPackages_cachyos;
kernelPackages = pkgs.linuxPackages_cachyos;
supportedFilesystems = ["btrfs" "ntfs"];
initrd.systemd = {
enable = true;
emergencyAccess = true; # No password needed because of LUKS
};
# initrd.systemd = {
# enable = true;
# emergencyAccess = true; # No password needed because of LUKS
# };
plymouth = {
enable = true;
@ -147,7 +147,7 @@ with lib // pkgs // inputs; {
extraModprobeConfig =
"options nvidia "
+ concatStringsSep " " [
+ lib.concatStringsSep " " [
"NVreg_UsePageAttributeTable=1"
"NVreg_EnablePCIeGen3=1"
"NVreg_RegistryDwords=RMUseSwI2c=0x01;RMI2cSpeed=100"
@ -172,17 +172,9 @@ with lib // pkgs // inputs; {
};
nix = let
mappedRegistry = pipe inputs [
(filterAttrs (_: isType "flake"))
(mapAttrs (_: flake: {inherit flake;}))
(x: x // {nixpkgs.flake = nixpkgs;})
];
nixSuper = nix-super.packages.${system}.default;
nixSuper = inputs.nix-super.packages.${pkgs.system}.default;
in {
package = mkForce nixSuper;
registry = mappedRegistry // optionalAttrs (config.nix.package == nixSuper) {default = mappedRegistry.nixpkgs;};
nixPath = mapAttrsToList (key: _: "${key}=flake:${key}") config.nix.registry;
package = lib.mkForce nixSuper;
daemonCPUSchedPolicy = "batch";
daemonIOSchedClass = "idle";
@ -261,7 +253,7 @@ with lib // pkgs // inputs; {
hyprland = {
enable = true;
package = hyprland.packages.${system}.hyprland;
package = inputs.hyprland.packages.${pkgs.system}.hyprland;
};
nh = {
@ -391,7 +383,7 @@ with lib // pkgs // inputs; {
};
networking = {
useDHCP = mkDefault true;
useDHCP = lib.mkDefault true;
hostName = "navis";
firewall.enable = false;
nameservers = ["1.1.1.1" "1.0.0.1"];
@ -415,23 +407,11 @@ with lib // pkgs // inputs; {
emacs = {
enable = true;
package = inputs.emacs.packages.${system}.default;
package = inputs.emacs.packages.${pkgs.system}.default;
};
# greetd = {
# enable = true;
# settings = rec {
# initial_session = {
# command = "${pkgs.hyprland}/bin/hyprland";
# user = "marshall";
# };
#
# default_session = initial_session;
# };
# };
desktopManager.cosmic.enable = true;
displayManager.cosmic-greeter.enable = true;
desktopManager.cosmic.enable = true;
libinput = {
enable = true;
@ -441,6 +421,18 @@ with lib // pkgs // inputs; {
xserver = {
enable = true;
videoDrivers = ["nvidia"];
displayManager.startx.enable = true;
windowManager.xmonad = {
enable = true;
enableContribAndExtras = true;
enableConfiguredRecompile = true;
flake = {
enable = true;
compiler = "ghc982";
};
};
};
pipewire = {
@ -457,7 +449,7 @@ with lib // pkgs // inputs; {
users.marshall = {
isNormalUser = true;
extraGroups = ["wheel" "gamemode" "libvirtd" "qemu-libvirtd" "disk" "networkmanager"];
shell = fish;
shell = pkgs.fish;
hashedPasswordFile = config.age.secrets.passwd.path;
};
};
@ -476,7 +468,7 @@ with lib // pkgs // inputs; {
graphics = {
enable = true;
enable32Bit = true;
extraPackages = [
extraPackages = with pkgs; [
vaapiVdpau
nvidia-vaapi-driver
];
@ -489,13 +481,6 @@ with lib // pkgs // inputs; {
modesetting.enable = true;
powerManagement.enable = true;
open = false;
prime = {
sync.enable = true;
intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:1:0:0";
};
};
};

View file

@ -20,35 +20,35 @@
options = ["subvol=root"];
};
boot.initrd.systemd.services.wipe-root = {
requires = ["dev-mapper-enc.device"];
after = ["dev-mapper-enc.device"];
wantedBy = ["initrd.target"];
script = 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.systemd.services.wipe-root = {
# requires = ["dev-mapper-enc.device"];
# after = ["dev-mapper-enc.device"];
# wantedBy = ["initrd.target"];
# script = 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";