Major rework in progress
This commit is contained in:
8
README.md
Normal file
8
README.md
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# NixOS System Configs
|
||||||
|
|
||||||
|
This is a repo for all of my nixos system configurations and isos
|
||||||
|
|
||||||
|
# Goal:
|
||||||
|
>- to define configs for all my nixos machines
|
||||||
|
>- to create a **100% reproduceable** system that can be deployed **offline** and **unattended**
|
||||||
|
|
||||||
57
flake.lock
generated
57
flake.lock
generated
@@ -7,11 +7,11 @@
|
|||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1,
|
"lastModified": 1,
|
||||||
"narHash": "sha256-hU9uZ4UrSrBntg9vhwQUzn7nC3UTeIV1iC5uprGhj+Y=",
|
"narHash": "sha256-hU9uZ4UrSrBntg9vhwQUzn7nC3UTeIV1iC5uprGhj+Y=",
|
||||||
"path": "/nix/store/h730mcqnqwjlpl3hrwdqrfyq26k9m5k1-source/ags",
|
"path": "/nix/store/yx9hd0zzj8k0jijpk9zp6g4g331jaisg-source/ags",
|
||||||
"type": "path"
|
"type": "path"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"path": "/nix/store/h730mcqnqwjlpl3hrwdqrfyq26k9m5k1-source/ags",
|
"path": "/nix/store/yx9hd0zzj8k0jijpk9zp6g4g331jaisg-source/ags",
|
||||||
"type": "path"
|
"type": "path"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -522,11 +522,11 @@
|
|||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1,
|
"lastModified": 1,
|
||||||
"narHash": "sha256-PoIwfLB8FwRvchRfLuR5Zt1Xez/G35ivu7y3ne4BrVo=",
|
"narHash": "sha256-PoIwfLB8FwRvchRfLuR5Zt1Xez/G35ivu7y3ne4BrVo=",
|
||||||
"path": "/nix/store/h730mcqnqwjlpl3hrwdqrfyq26k9m5k1-source/hyprland",
|
"path": "/nix/store/yx9hd0zzj8k0jijpk9zp6g4g331jaisg-source/hyprland",
|
||||||
"type": "path"
|
"type": "path"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"path": "/nix/store/h730mcqnqwjlpl3hrwdqrfyq26k9m5k1-source/hyprland",
|
"path": "/nix/store/yx9hd0zzj8k0jijpk9zp6g4g331jaisg-source/hyprland",
|
||||||
"type": "path"
|
"type": "path"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -961,12 +961,12 @@
|
|||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1,
|
"lastModified": 1,
|
||||||
"narHash": "sha256-pJxmKMNEj17fTvgM/URTMtX3AByFnif+0bjAueedzhw=",
|
"narHash": "sha256-MJ7qeRlZKHt+WoFCOYpFgNgRrBb/tD1cglGLG4Z5jLg=",
|
||||||
"path": "/nix/store/gmp80achy4a0wv7xhybr65dvc4sm744g-source/home",
|
"path": "/nix/store/21nf0p8ql9xkf5n5xw8p3qwy7dpp0zd7-source/home",
|
||||||
"type": "path"
|
"type": "path"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"path": "/nix/store/gmp80achy4a0wv7xhybr65dvc4sm744g-source/home",
|
"path": "/nix/store/21nf0p8ql9xkf5n5xw8p3qwy7dpp0zd7-source/home",
|
||||||
"type": "path"
|
"type": "path"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -1217,14 +1217,17 @@
|
|||||||
"nixvim": "nixvim_2"
|
"nixvim": "nixvim_2"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1,
|
"lastModified": 1727986301,
|
||||||
"narHash": "sha256-z7+Wa2JaaJyyGCiiEE6Ta5m7f98ZWVRQ6HV+Seu2tEM=",
|
"narHash": "sha256-z7+Wa2JaaJyyGCiiEE6Ta5m7f98ZWVRQ6HV+Seu2tEM=",
|
||||||
"path": "/nix/store/h730mcqnqwjlpl3hrwdqrfyq26k9m5k1-source/nixvim",
|
"ref": "refs/heads/master",
|
||||||
"type": "path"
|
"rev": "e6cb7d523142dc038c816fe5be57c19cf7a8d5f3",
|
||||||
|
"revCount": 1,
|
||||||
|
"type": "git",
|
||||||
|
"url": "file:///home/nathan/Projects/Nixvim"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"path": "/nix/store/h730mcqnqwjlpl3hrwdqrfyq26k9m5k1-source/nixvim",
|
"type": "git",
|
||||||
"type": "path"
|
"url": "file:///home/nathan/Projects/Nixvim"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixvim_2": {
|
"nixvim_2": {
|
||||||
@@ -1300,11 +1303,11 @@
|
|||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1,
|
"lastModified": 1,
|
||||||
"narHash": "sha256-c/j1wAoDhJC3sxfp1mX1p3FfQdksPp20wnRXQPxwT+g=",
|
"narHash": "sha256-c/j1wAoDhJC3sxfp1mX1p3FfQdksPp20wnRXQPxwT+g=",
|
||||||
"path": "/nix/store/dhn1damhdzzk9kvrd185llvb8lj7p0m9-source/packages",
|
"path": "/nix/store/nz05qzah5l5ch4cb4gl1vbc4qyh1grna-source/packages",
|
||||||
"type": "path"
|
"type": "path"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"path": "/nix/store/dhn1damhdzzk9kvrd185llvb8lj7p0m9-source/packages",
|
"path": "/nix/store/nz05qzah5l5ch4cb4gl1vbc4qyh1grna-source/packages",
|
||||||
"type": "path"
|
"type": "path"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -1334,12 +1337,12 @@
|
|||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1,
|
"lastModified": 1,
|
||||||
"narHash": "sha256-lIWkTRmFS1h/L9rM+lZX/AHv/aET4tw8GExvv6EEh5I=",
|
"narHash": "sha256-7zc0u56+lt5YSb1qOMyLKh2b0B0vvUGm2K6mDVt761U=",
|
||||||
"path": "/nix/store/dhn1damhdzzk9kvrd185llvb8lj7p0m9-source/programs",
|
"path": "/nix/store/nz05qzah5l5ch4cb4gl1vbc4qyh1grna-source/programs",
|
||||||
"type": "path"
|
"type": "path"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"path": "/nix/store/dhn1damhdzzk9kvrd185llvb8lj7p0m9-source/programs",
|
"path": "/nix/store/nz05qzah5l5ch4cb4gl1vbc4qyh1grna-source/programs",
|
||||||
"type": "path"
|
"type": "path"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -1369,11 +1372,11 @@
|
|||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1,
|
"lastModified": 1,
|
||||||
"narHash": "sha256-EVhBDAt1miiP7BA3SooJNTCm0pESsl4VlRYCDSMutFY=",
|
"narHash": "sha256-EVhBDAt1miiP7BA3SooJNTCm0pESsl4VlRYCDSMutFY=",
|
||||||
"path": "/nix/store/h730mcqnqwjlpl3hrwdqrfyq26k9m5k1-source/pywal",
|
"path": "/nix/store/yx9hd0zzj8k0jijpk9zp6g4g331jaisg-source/pywal",
|
||||||
"type": "path"
|
"type": "path"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"path": "/nix/store/h730mcqnqwjlpl3hrwdqrfyq26k9m5k1-source/pywal",
|
"path": "/nix/store/yx9hd0zzj8k0jijpk9zp6g4g331jaisg-source/pywal",
|
||||||
"type": "path"
|
"type": "path"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -1397,11 +1400,11 @@
|
|||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1,
|
"lastModified": 1,
|
||||||
"narHash": "sha256-W1pO/5h94bemSfBkgwMcjnRJAySAtzd5RMTWKcmLkOI=",
|
"narHash": "sha256-W1pO/5h94bemSfBkgwMcjnRJAySAtzd5RMTWKcmLkOI=",
|
||||||
"path": "/nix/store/h730mcqnqwjlpl3hrwdqrfyq26k9m5k1-source/rofi",
|
"path": "/nix/store/yx9hd0zzj8k0jijpk9zp6g4g331jaisg-source/rofi",
|
||||||
"type": "path"
|
"type": "path"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"path": "/nix/store/h730mcqnqwjlpl3hrwdqrfyq26k9m5k1-source/rofi",
|
"path": "/nix/store/yx9hd0zzj8k0jijpk9zp6g4g331jaisg-source/rofi",
|
||||||
"type": "path"
|
"type": "path"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -1482,11 +1485,11 @@
|
|||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1,
|
"lastModified": 1,
|
||||||
"narHash": "sha256-cuHsChgkjeeNyQiP8xebtVcqixs7dJLV59Q9BKIVXqI=",
|
"narHash": "sha256-cuHsChgkjeeNyQiP8xebtVcqixs7dJLV59Q9BKIVXqI=",
|
||||||
"path": "/nix/store/dhn1damhdzzk9kvrd185llvb8lj7p0m9-source/services",
|
"path": "/nix/store/nz05qzah5l5ch4cb4gl1vbc4qyh1grna-source/services",
|
||||||
"type": "path"
|
"type": "path"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"path": "/nix/store/dhn1damhdzzk9kvrd185llvb8lj7p0m9-source/services",
|
"path": "/nix/store/nz05qzah5l5ch4cb4gl1vbc4qyh1grna-source/services",
|
||||||
"type": "path"
|
"type": "path"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -1515,11 +1518,11 @@
|
|||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1,
|
"lastModified": 1,
|
||||||
"narHash": "sha256-M8gn3JNWaujqDckXceQofrr/295Qt2puwAcxkR7p3DI=",
|
"narHash": "sha256-M8gn3JNWaujqDckXceQofrr/295Qt2puwAcxkR7p3DI=",
|
||||||
"path": "/nix/store/gmp80achy4a0wv7xhybr65dvc4sm744g-source/system",
|
"path": "/nix/store/21nf0p8ql9xkf5n5xw8p3qwy7dpp0zd7-source/system",
|
||||||
"type": "path"
|
"type": "path"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"path": "/nix/store/gmp80achy4a0wv7xhybr65dvc4sm744g-source/system",
|
"path": "/nix/store/21nf0p8ql9xkf5n5xw8p3qwy7dpp0zd7-source/system",
|
||||||
"type": "path"
|
"type": "path"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -1596,11 +1599,11 @@
|
|||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1,
|
"lastModified": 1,
|
||||||
"narHash": "sha256-2h0M0hXa3L6rQJ2hmDadiZBYJcoxRqFdlXD7tK0LFrM=",
|
"narHash": "sha256-2h0M0hXa3L6rQJ2hmDadiZBYJcoxRqFdlXD7tK0LFrM=",
|
||||||
"path": "/nix/store/h730mcqnqwjlpl3hrwdqrfyq26k9m5k1-source/terminal",
|
"path": "/nix/store/yx9hd0zzj8k0jijpk9zp6g4g331jaisg-source/terminal",
|
||||||
"type": "path"
|
"type": "path"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"path": "/nix/store/h730mcqnqwjlpl3hrwdqrfyq26k9m5k1-source/terminal",
|
"path": "/nix/store/yx9hd0zzj8k0jijpk9zp6g4g331jaisg-source/terminal",
|
||||||
"type": "path"
|
"type": "path"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
99
flake.nix
99
flake.nix
@@ -5,44 +5,93 @@
|
|||||||
|
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
|
||||||
|
|
||||||
home-manager.url = "github:nix-community/home-manager/release-24.05";
|
home-manager = {
|
||||||
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
url = "github:nix-community/home-manager/release-24.05";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
|
||||||
nathan.url = "./home";
|
nathan.url = "./home";
|
||||||
|
|
||||||
system.url = "./system";
|
system.url = "./system";
|
||||||
|
system.inputs.disko.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, ... }@inputs:
|
outputs = { self, nixpkgs, ... }@core_inputs: let
|
||||||
let
|
system = "x86_64-linux";
|
||||||
system = "x86_64-linux";
|
iso_system = "x86_64-linux";
|
||||||
in {
|
|
||||||
inputs.home-manager.useGlobalPkgs = true;
|
|
||||||
|
|
||||||
nixosConfigurations.laptop = nixpkgs.lib.nixosSystem {
|
host = "laptop";
|
||||||
|
username = "nathan";
|
||||||
|
|
||||||
inherit system;
|
devices = {
|
||||||
specialArgs = { inherit inputs; };
|
main = "/dev/nvme0n1";
|
||||||
|
bonus = null;
|
||||||
|
};
|
||||||
|
|
||||||
modules = [
|
in rec {
|
||||||
inputs.system.nixosModule
|
inputs.home-manager.useGlobalPkgs = true;
|
||||||
inputs.home-manager.nixosModules.home-manager
|
|
||||||
];
|
|
||||||
|
|
||||||
};
|
nixosConfigurations.${host} = nixpkgs.lib.nixosSystem {
|
||||||
|
|
||||||
homeConfigurations."nathan" = inputs.home-manager.lib.homeManagerConfiguration {
|
inherit system;
|
||||||
pkgs = import nixpkgs {
|
specialArgs = {
|
||||||
inherit system;
|
core_inputs = (core_inputs // { inherit host username; });
|
||||||
config.allowUnfree = true;
|
inherit devices;
|
||||||
};
|
};
|
||||||
extraSpecialArgs = { inherit inputs; };
|
|
||||||
|
|
||||||
modules = [ inputs.nathan.homeManagerModule ];
|
modules = [
|
||||||
};
|
inputs.system.nixosModule
|
||||||
|
inputs.home-manager.nixosModules.home-manager
|
||||||
|
|
||||||
};
|
({ lib, ... }: {
|
||||||
|
sysconfig.${host}.enable = true;
|
||||||
|
disko.enable = lib.mkForce false;
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
nixosConfigurations.iso = nixpkgs.lib.nixosSystem {
|
||||||
|
inherit iso_system;
|
||||||
|
|
||||||
|
specialArgs = {
|
||||||
|
core_inputs = (core_inputs // { inherit host username; });
|
||||||
|
devices = (devices // {
|
||||||
|
bonus = {
|
||||||
|
disk1 = "/dev/nvme1n1";
|
||||||
|
};
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
modules = [
|
||||||
|
|
||||||
|
({ pkgs, modulesPath, ... }: {
|
||||||
|
imports = [
|
||||||
|
(modulesPath + "/installer/cd-dvd/installation-cd-minimal.nix")
|
||||||
|
];
|
||||||
|
|
||||||
|
nixpkgs.hostPlatform = iso_system;
|
||||||
|
})
|
||||||
|
|
||||||
|
#inputs.system.nixosModule
|
||||||
|
#inputs.home-manager.nixosModules.home-manager
|
||||||
|
];
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
packages.${iso_system}.default = nixosConfigurations.iso.config.system.build.isoImage;
|
||||||
|
|
||||||
|
homeConfigurations."nathan" = inputs.home-manager.lib.homeManagerConfiguration {
|
||||||
|
pkgs = import nixpkgs {
|
||||||
|
inherit system;
|
||||||
|
config.allowUnfree = true;
|
||||||
|
};
|
||||||
|
extraSpecialArgs = { inherit inputs; };
|
||||||
|
|
||||||
|
modules = [ inputs.nathan.homeManagerModule ];
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
28
home/impermanence/default.nix
Normal file
28
home/impermanence/default.nix
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
{ config, lib, self, ... }: {
|
||||||
|
|
||||||
|
imports = [
|
||||||
|
self.inputs.impermanence.nixosModules.home-manager.impermanence
|
||||||
|
];
|
||||||
|
|
||||||
|
config = lib.mkIf config.disko.impermanent {
|
||||||
|
|
||||||
|
home.persistence."/persist/home" = {
|
||||||
|
|
||||||
|
directories = [
|
||||||
|
"Documents"
|
||||||
|
"Music"
|
||||||
|
"Pictures"
|
||||||
|
"Videos"
|
||||||
|
".ssh"
|
||||||
|
".config"
|
||||||
|
".local"
|
||||||
|
|
||||||
|
];
|
||||||
|
files = [
|
||||||
|
".cache/bg"
|
||||||
|
".cache/bga"
|
||||||
|
];
|
||||||
|
allowOther = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
10
home/impermanence/flake.nix
Normal file
10
home/impermanence/flake.nix
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
description = "nix impermanence home config";
|
||||||
|
|
||||||
|
inputs.impermanence.url = "github:nix-community/impermanence";
|
||||||
|
|
||||||
|
outputs = { self, ... }: {
|
||||||
|
hmModule = import ./. { inherit self; };
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
85
home/packages/default.nix
Normal file
85
home/packages/default.nix
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
{ pkgs, pkgs-us, self, ... }: {
|
||||||
|
|
||||||
|
imports = [
|
||||||
|
self.inputs.scripts.hmModule
|
||||||
|
self.inputs.external.hmModule
|
||||||
|
];
|
||||||
|
|
||||||
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
|
||||||
|
home.packages = with pkgs; let
|
||||||
|
pypkgs = ps: with ps; [
|
||||||
|
numpy
|
||||||
|
pandas
|
||||||
|
torch
|
||||||
|
torchvision
|
||||||
|
torchaudio
|
||||||
|
transformers
|
||||||
|
datasets
|
||||||
|
pyaudio
|
||||||
|
faster-whisper
|
||||||
|
pyusb
|
||||||
|
];
|
||||||
|
|
||||||
|
in [
|
||||||
|
|
||||||
|
cava
|
||||||
|
gcc
|
||||||
|
android-tools
|
||||||
|
|
||||||
|
(pkgs.python311.withPackages pypkgs)
|
||||||
|
|
||||||
|
brightnessctl
|
||||||
|
libdbusmenu-gtk3
|
||||||
|
zulu
|
||||||
|
lmms
|
||||||
|
killall
|
||||||
|
youtube-music
|
||||||
|
#unfree {
|
||||||
|
geogebra
|
||||||
|
#}
|
||||||
|
blueberry
|
||||||
|
wl-clipboard
|
||||||
|
firefox-wayland
|
||||||
|
swaylock-effects
|
||||||
|
|
||||||
|
neofetch
|
||||||
|
pkgs-us.mpv
|
||||||
|
(ncmpcpp.override { visualizerSupport = true; clockSupport = true; })
|
||||||
|
playerctl
|
||||||
|
mpc-cli
|
||||||
|
xfce.thunar
|
||||||
|
vlc
|
||||||
|
zip
|
||||||
|
unzip
|
||||||
|
pavucontrol
|
||||||
|
yewtube
|
||||||
|
ytmdl
|
||||||
|
ffmpeg_5
|
||||||
|
lxqt.lxqt-policykit
|
||||||
|
rpi-imager
|
||||||
|
rsync
|
||||||
|
grim
|
||||||
|
slurp
|
||||||
|
tigervnc
|
||||||
|
keepassxc
|
||||||
|
httplz
|
||||||
|
|
||||||
|
#school?
|
||||||
|
#pkgs-us.digital
|
||||||
|
|
||||||
|
#3D modeling/printing
|
||||||
|
kicad
|
||||||
|
blender
|
||||||
|
freecad
|
||||||
|
cura
|
||||||
|
|
||||||
|
#productivity
|
||||||
|
libreoffice
|
||||||
|
super-productivity
|
||||||
|
|
||||||
|
#games
|
||||||
|
prismlauncher
|
||||||
|
];
|
||||||
|
|
||||||
|
}
|
||||||
15
home/packages/external/default.nix
vendored
Normal file
15
home/packages/external/default.nix
vendored
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
{ config, lib, pkgs, self, ... }: {
|
||||||
|
|
||||||
|
options = {
|
||||||
|
externalPackages.enable = lib.options.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf config.externalPackages.enable {
|
||||||
|
home.packages = [
|
||||||
|
self.packages.${pkgs.system}.digital
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
9
home/packages/external/flake.nix
vendored
9
home/packages/external/flake.nix
vendored
@@ -14,7 +14,7 @@
|
|||||||
outputs = { self, ... }@inputs: let
|
outputs = { self, ... }@inputs: let
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
_pkgs = import inputs.nixpkgs { inherit system; };
|
_pkgs = import inputs.nixpkgs { inherit system; };
|
||||||
in rec {
|
in {
|
||||||
|
|
||||||
packages.${system}.digital = _pkgs.stdenv.mkDerivation {
|
packages.${system}.digital = _pkgs.stdenv.mkDerivation {
|
||||||
|
|
||||||
@@ -34,12 +34,7 @@
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
hmModule = { config, lib, pkgs, ... }: {
|
hmModule = import ./. { inherit self; };
|
||||||
|
|
||||||
home.packages = [
|
|
||||||
packages.${pkgs.system}.digital
|
|
||||||
];
|
|
||||||
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
description = "Nathan user packages";
|
description = "Nathan user packages";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs-old.url = "github:nixos/nixpkgs/nixos-23.11";
|
|
||||||
nixpkgs-us.url = "github:nixos/nixpkgs/nixos-unstable";
|
nixpkgs-us.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
|
|
||||||
scripts.url = "./scripts";
|
scripts.url = "./scripts";
|
||||||
@@ -14,103 +13,14 @@
|
|||||||
outputs = { self, ... }@inputs: let
|
outputs = { self, ... }@inputs: let
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
|
|
||||||
pkgs-old = import inputs.nixpkgs-old {
|
|
||||||
inherit system;
|
|
||||||
config.allowUnfree = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
pkgs-us = import inputs.nixpkgs-us {
|
pkgs-us = import inputs.nixpkgs-us {
|
||||||
inherit system;
|
inherit system;
|
||||||
config.allowUnfree = true;
|
config.allowUnfree = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
in {
|
in {
|
||||||
|
|
||||||
hmModule = { config, lib, pkgs, ... }: {
|
hmModule = import ./. { inherit pkgs-us self; };
|
||||||
|
|
||||||
imports = [
|
|
||||||
inputs.scripts.hmModule
|
|
||||||
inputs.external.hmModule
|
|
||||||
];
|
|
||||||
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
|
||||||
|
|
||||||
home.packages = with pkgs; let
|
|
||||||
pypkgs = ps: with ps; [
|
|
||||||
numpy
|
|
||||||
pandas
|
|
||||||
torch
|
|
||||||
torchvision
|
|
||||||
torchaudio
|
|
||||||
transformers
|
|
||||||
datasets
|
|
||||||
pyaudio
|
|
||||||
faster-whisper
|
|
||||||
pyusb
|
|
||||||
];
|
|
||||||
|
|
||||||
in [
|
|
||||||
|
|
||||||
cava
|
|
||||||
gcc
|
|
||||||
android-tools
|
|
||||||
|
|
||||||
(pkgs.python311.withPackages pypkgs)
|
|
||||||
|
|
||||||
brightnessctl
|
|
||||||
libdbusmenu-gtk3
|
|
||||||
zulu
|
|
||||||
lmms
|
|
||||||
killall
|
|
||||||
youtube-music
|
|
||||||
#unfree {
|
|
||||||
geogebra
|
|
||||||
#}
|
|
||||||
blueberry
|
|
||||||
wl-clipboard
|
|
||||||
firefox-wayland
|
|
||||||
swaylock-effects
|
|
||||||
|
|
||||||
neofetch
|
|
||||||
pkgs-us.mpv
|
|
||||||
(ncmpcpp.override { visualizerSupport = true; clockSupport = true; })
|
|
||||||
playerctl
|
|
||||||
mpc-cli
|
|
||||||
xfce.thunar
|
|
||||||
vlc
|
|
||||||
zip
|
|
||||||
unzip
|
|
||||||
pavucontrol
|
|
||||||
yewtube
|
|
||||||
ytmdl
|
|
||||||
ffmpeg_5
|
|
||||||
lxqt.lxqt-policykit
|
|
||||||
rpi-imager
|
|
||||||
rsync
|
|
||||||
grim
|
|
||||||
slurp
|
|
||||||
tigervnc
|
|
||||||
keepassxc
|
|
||||||
httplz
|
|
||||||
|
|
||||||
#school?
|
|
||||||
#pkgs-us.digital
|
|
||||||
|
|
||||||
#3D modeling/printing
|
|
||||||
kicad
|
|
||||||
blender
|
|
||||||
freecad
|
|
||||||
cura
|
|
||||||
|
|
||||||
#productivity
|
|
||||||
libreoffice
|
|
||||||
super-productivity
|
|
||||||
|
|
||||||
#games
|
|
||||||
prismlauncher
|
|
||||||
];
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
104
home/packages/scripts/default.nix
Normal file
104
home/packages/scripts/default.nix
Normal file
@@ -0,0 +1,104 @@
|
|||||||
|
{ config, lib, pkgs, ... }: {
|
||||||
|
|
||||||
|
options = {
|
||||||
|
homeScripts.enable = lib.options.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf config.homeScripts.enable {
|
||||||
|
home.packages = [
|
||||||
|
|
||||||
|
#scripts
|
||||||
|
(pkgs.writeShellScriptBin "_systemRebuild" ''
|
||||||
|
sudo nix flake lock /home/nathan/Projects/System --update-input nathan --update-input root --update-input system
|
||||||
|
${pkgs.nh}/bin/nh os switch --ask /home/nathan/Projects/System
|
||||||
|
echo //////Enter to close//////
|
||||||
|
read
|
||||||
|
'')
|
||||||
|
(pkgs.writeShellScriptBin "_homeRebuild" ''
|
||||||
|
sudo nix flake lock /home/nathan/Projects/System --update-input nathan
|
||||||
|
${pkgs.nh}/bin/nh home switch --ask /home/nathan/Projects/System
|
||||||
|
echo //////Enter to close//////
|
||||||
|
read
|
||||||
|
'')
|
||||||
|
(pkgs.writeShellScriptBin "addCoverArtMP3" ''
|
||||||
|
if [[ $# != 2 ]]
|
||||||
|
then echo "usage: addCoverArtMP3 song.mp3 image.jpg"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
mv $1 copyof$1
|
||||||
|
ffmpeg -i copyof$1 -i $2 -map_metadata 0 -map 0 -map 1 -acodec copy $1
|
||||||
|
'')
|
||||||
|
|
||||||
|
(pkgs.writeShellScriptBin "randWallpaper" ''
|
||||||
|
file=$(ls /home/nathan/Pictures/Wallpaper/ | shuf -n 1)
|
||||||
|
setWallpaper /home/nathan/Pictures/Wallpaper/$file
|
||||||
|
'')
|
||||||
|
|
||||||
|
(pkgs.writeShellScriptBin "setWallpaper" ''
|
||||||
|
img=''$(realpath ''${1:-~/.cache/bg})
|
||||||
|
p=''$(ps -e | grep mpvpaper | sed -n -e "s/ *//" -e "s/ /\n/" -e "1 P")
|
||||||
|
${pkgs.mpvpaper}/bin/mpvpaper -f -o "loop" '*' $img && \
|
||||||
|
changeColors $img $2 && \
|
||||||
|
sleep 0.4 && \
|
||||||
|
kill $p
|
||||||
|
'')
|
||||||
|
|
||||||
|
(pkgs.writeShellScriptBin "changeColors" ''
|
||||||
|
|
||||||
|
if [[ $(ls ~/.cache/ | grep bga) != bga ]]; then
|
||||||
|
echo 100 > ~/.cache/bga
|
||||||
|
fi
|
||||||
|
|
||||||
|
alpha=''${2:-`cat ~/.cache/bga`}
|
||||||
|
|
||||||
|
img=''$(realpath ''${1:-~/.cache/bg})
|
||||||
|
|
||||||
|
if [[ $alpha -lt 0 ]]; then
|
||||||
|
$alpha=0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $alpha -gt 100 ]]; then
|
||||||
|
$alpha=100
|
||||||
|
fi
|
||||||
|
|
||||||
|
wal -i $img -a $alpha --cols16 -n
|
||||||
|
|
||||||
|
echo $alpha > ~/.cache/bga
|
||||||
|
|
||||||
|
rm ~/.cache/bg
|
||||||
|
ln -s $img ~/.cache/bg
|
||||||
|
|
||||||
|
sleep 0.4
|
||||||
|
|
||||||
|
pywalfox update &
|
||||||
|
|
||||||
|
themecord > ~/.cache/_.txt && rm ~/.cache/_.txt
|
||||||
|
|
||||||
|
[[ $(pidof cava) != "" ]] && pkill -USR1 cava &
|
||||||
|
|
||||||
|
for i in $(ls /run/user/1000 | grep nvim); do nvr -s --servername /run/user/1000/$i --remote-send '<cmd>colorscheme pywal<CR>'; done
|
||||||
|
|
||||||
|
pkill -USR1 kitty
|
||||||
|
'')
|
||||||
|
|
||||||
|
(pkgs.writeShellScriptBin "onSystemStart" ''
|
||||||
|
ags &
|
||||||
|
pypr &
|
||||||
|
setWallpaper &
|
||||||
|
lxqt-policykit-agent &
|
||||||
|
nmcli device wifi connect EagleNet password '~?C#@ZiH' &
|
||||||
|
hyprctl setcursor Bibata-Modern-Classic 16 &
|
||||||
|
'')
|
||||||
|
|
||||||
|
(pkgs.writeShellScriptBin "colorPrefix" ''
|
||||||
|
exec -a "$0" "$@" &
|
||||||
|
sleep 0.4 && changeColors &
|
||||||
|
'')
|
||||||
|
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
@@ -1,106 +1,12 @@
|
|||||||
{
|
{
|
||||||
description = "Nathan user scripts";
|
description = "Nathan user scripts";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
};
|
|
||||||
|
|
||||||
outputs = { self, ... }: {
|
|
||||||
|
|
||||||
hmModule = { config, lib, pkgs, ... }: {
|
|
||||||
|
|
||||||
home.packages = [
|
|
||||||
|
|
||||||
#scripts
|
|
||||||
(pkgs.writeShellScriptBin "_systemRebuild" ''
|
|
||||||
sudo nix flake lock /home/nathan/Projects/System --update-input nathan --update-input root --update-input system
|
|
||||||
${pkgs.nh}/bin/nh os switch --ask /home/nathan/Projects/System
|
|
||||||
echo //////Enter to close//////
|
|
||||||
read
|
|
||||||
'')
|
|
||||||
(pkgs.writeShellScriptBin "_homeRebuild" ''
|
|
||||||
sudo nix flake lock /home/nathan/Projects/System --update-input nathan
|
|
||||||
${pkgs.nh}/bin/nh home switch --ask /home/nathan/Projects/System
|
|
||||||
echo //////Enter to close//////
|
|
||||||
read
|
|
||||||
'')
|
|
||||||
(pkgs.writeShellScriptBin "addCoverArtMP3" ''
|
|
||||||
if [[ $# != 2 ]]
|
|
||||||
then echo "usage: addCoverArtMP3 song.mp3 image.jpg"
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
mv $1 copyof$1
|
|
||||||
ffmpeg -i copyof$1 -i $2 -map_metadata 0 -map 0 -map 1 -acodec copy $1
|
|
||||||
'')
|
|
||||||
|
|
||||||
(pkgs.writeShellScriptBin "randWallpaper" ''
|
|
||||||
file=$(ls /home/nathan/Pictures/Wallpaper/ | shuf -n 1)
|
|
||||||
setWallpaper /home/nathan/Pictures/Wallpaper/$file
|
|
||||||
'')
|
|
||||||
|
|
||||||
(pkgs.writeShellScriptBin "setWallpaper" ''
|
|
||||||
|
|
||||||
img=''$(realpath ''${1:-~/.cache/bg})
|
|
||||||
p=''$(ps -e | grep mpvpaper | sed -n -e "s/ *//" -e "s/ /\n/" -e "1 P")
|
|
||||||
${pkgs.mpvpaper}/bin/mpvpaper -f -o "loop" '*' $img && \
|
|
||||||
changeColors $img $2 && \
|
|
||||||
sleep 0.4 && \
|
|
||||||
kill $p
|
|
||||||
'')
|
|
||||||
|
|
||||||
(pkgs.writeShellScriptBin "changeColors" ''
|
|
||||||
|
|
||||||
if [[ $(ls ~/.cache/ | grep bga) != bga ]]; then
|
|
||||||
echo 100 > ~/.cache/bga
|
|
||||||
fi
|
|
||||||
|
|
||||||
alpha=''${2:-`cat ~/.cache/bga`}
|
|
||||||
|
|
||||||
img=''$(realpath ''${1:-~/.cache/bg})
|
|
||||||
|
|
||||||
if [[ $alpha -lt 0 ]]; then
|
|
||||||
$alpha=0
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $alpha -gt 100 ]]; then
|
|
||||||
$alpha=100
|
|
||||||
fi
|
|
||||||
|
|
||||||
wal -i $img -a $alpha --cols16 -n
|
|
||||||
|
|
||||||
echo $alpha > ~/.cache/bga
|
|
||||||
|
|
||||||
rm ~/.cache/bg
|
|
||||||
ln -s $img ~/.cache/bg
|
|
||||||
|
|
||||||
sleep 0.4
|
|
||||||
|
|
||||||
pywalfox update &
|
|
||||||
|
|
||||||
themecord > ~/.cache/_.txt && rm ~/.cache/_.txt
|
|
||||||
|
|
||||||
[[ $(pidof cava) != "" ]] && pkill -USR1 cava &
|
|
||||||
|
|
||||||
for i in $(ls /run/user/1000 | grep nvim); do nvr -s --servername /run/user/1000/$i --remote-send '<cmd>colorscheme pywal<CR>'; done
|
|
||||||
|
|
||||||
pkill -USR1 kitty
|
|
||||||
'')
|
|
||||||
|
|
||||||
(pkgs.writeShellScriptBin "onSystemStart" ''
|
|
||||||
ags &
|
|
||||||
pypr &
|
|
||||||
setWallpaper &
|
|
||||||
lxqt-policykit-agent &
|
|
||||||
nmcli device wifi connect EagleNet password '~?C#@ZiH' &
|
|
||||||
hyprctl setcursor Bibata-Modern-Classic 16 &
|
|
||||||
'')
|
|
||||||
|
|
||||||
(pkgs.writeShellScriptBin "colorPrefix" ''
|
|
||||||
exec -a "$0" "$@" &
|
|
||||||
sleep 0.4 && changeColors &
|
|
||||||
'')
|
|
||||||
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
outputs = { self, ... }: {
|
||||||
|
|
||||||
|
hmModule = import ./.;
|
||||||
|
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
inputs.nixvim.packages.${pkgs.system}.default
|
inputs.nixvim.packages.${pkgs.system}.default
|
||||||
];
|
];
|
||||||
|
|
||||||
home.sessionVarriables.EDITOR = "nvim";
|
home.sessionVariables.EDITOR = "nvim";
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -319,7 +319,9 @@ bind = $mainMod SHIFT, E, exec, colorPrefix pypr toggle free
|
|||||||
|
|
||||||
|
|
||||||
bind = CTRL SHIFT, Home, exec, ssh -i ~/.ssh/key nathan@69.150.99.129 -fL 5900:localhost:5900 sleep 10; vncviewer localhost:5900 -fullscreen
|
bind = CTRL SHIFT, Home, exec, ssh -i ~/.ssh/key nathan@69.150.99.129 -fL 5900:localhost:5900 sleep 10; vncviewer localhost:5900 -fullscreen
|
||||||
|
bind = CTRL SHIFT, End, exec, ssh -i ~/.ssh/key nathan@173.242.244.284 -fL 5900:localhost:5900 sleep 10; vncviewer localhost:5900 -fullscreen
|
||||||
bind = CTRL SHIFT, Home, submap, clean
|
bind = CTRL SHIFT, Home, submap, clean
|
||||||
|
bind = CTRL SHIFT, End, submap, clean
|
||||||
|
|
||||||
|
|
||||||
bind = $mainMod CTRL, Home, submap, clean
|
bind = $mainMod CTRL, Home, submap, clean
|
||||||
|
|||||||
12
system/configuration/default.nix
Normal file
12
system/configuration/default.nix
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{ config, lib, pkgs, ... }: {
|
||||||
|
|
||||||
|
imports = [
|
||||||
|
./generic
|
||||||
|
./laptop
|
||||||
|
./homebox
|
||||||
|
];
|
||||||
|
|
||||||
|
sysconfig.laptop.enable = lib.mkDefault false;
|
||||||
|
sysconfig.homebox.enable = lib.mkDefault false;
|
||||||
|
sysconfig.generic.enable = lib.mkDefault true;
|
||||||
|
}
|
||||||
1
system/configuration/generic/default.nix
Normal file
1
system/configuration/generic/default.nix
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{}
|
||||||
1
system/configuration/homebox/default.nix
Normal file
1
system/configuration/homebox/default.nix
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{}
|
||||||
77
system/configuration/laptop/default.nix
Normal file
77
system/configuration/laptop/default.nix
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
# Edit this configuration file to define what should be installed on
|
||||||
|
# your system. Help is available in the configuration.nix(5) man page
|
||||||
|
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
||||||
|
|
||||||
|
{ config, lib, pkgs, core_inputs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
options = {
|
||||||
|
sysconfig.laptop.enable = lib.mkEnableOption "uses laptop config";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf config.sysconfig.laptop.enable {
|
||||||
|
|
||||||
|
assertions = [
|
||||||
|
{
|
||||||
|
assertion = !config.sysconfig.homebox.enable;
|
||||||
|
message = "sysconfig laptop conflicts with homebox";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
imports = [];
|
||||||
|
|
||||||
|
boot = {
|
||||||
|
loader = {
|
||||||
|
systemd-boot.enable = true;
|
||||||
|
efi.canTouchEfiVariables = true;
|
||||||
|
};
|
||||||
|
kernelParams = [ "snd-intel-dspcfg.dsp_driver=1" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
hardware = {
|
||||||
|
opengl = {
|
||||||
|
enable = true;
|
||||||
|
driSupport = true;
|
||||||
|
extraPackages = with pkgs; [
|
||||||
|
nvidia-vaapi-driver
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
nvidia = {
|
||||||
|
modesetting.enable = true;
|
||||||
|
open = false; #suspend fails with open drivers
|
||||||
|
nvidiaSettings = true;
|
||||||
|
package = config.boot.kernelPackages.nvidiaPackages.beta;
|
||||||
|
prime = {
|
||||||
|
intelBusId = "PCI:0:2:0";
|
||||||
|
nvidiaBusId = "PCI:1:0:0";
|
||||||
|
# #sync.enable = true;
|
||||||
|
offload = {
|
||||||
|
enable = true;
|
||||||
|
enableOffloadCmd = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
bluetooth.enable = true;
|
||||||
|
|
||||||
|
pulseaudio.enable = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
networking = {
|
||||||
|
hostName = "laptop";
|
||||||
|
nameservers = [ "1.1.1.1#one.one.one.one" "1.0.0.1#one.one.one.one" ];
|
||||||
|
networkmanager.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
services = {
|
||||||
|
xserver = {
|
||||||
|
enable = true;
|
||||||
|
videoDrivers = [ "nvidia" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
displayManager.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
39
system/configuration/laptop/hardware-configuration.nix
Normal file
39
system/configuration/laptop/hardware-configuration.nix
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
# 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, pkgs, modulesPath, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports =
|
||||||
|
[ (modulesPath + "/installer/scan/not-detected.nix")
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" "sdhci_pci" ];
|
||||||
|
boot.initrd.kernelModules = [ ];
|
||||||
|
boot.kernelModules = [ "kvm-intel" ];
|
||||||
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
|
fileSystems."/" =
|
||||||
|
{ device = "/dev/disk/by-uuid/78c0964d-c09e-4e31-8a73-eb719d79917a";
|
||||||
|
fsType = "ext4";
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/boot" =
|
||||||
|
{ device = "/dev/disk/by-uuid/AE5E-AC86";
|
||||||
|
fsType = "vfat";
|
||||||
|
options = [ "fmask=0022" "dmask=0022" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
swapDevices = [ ];
|
||||||
|
|
||||||
|
# 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
|
||||||
|
# still possible to use this option, but it's recommended to use it in conjunction
|
||||||
|
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||||
|
networking.useDHCP = lib.mkDefault true;
|
||||||
|
# networking.interfaces.eno1.useDHCP = lib.mkDefault true;
|
||||||
|
# networking.interfaces.wlo1.useDHCP = lib.mkDefault true;
|
||||||
|
|
||||||
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
|
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
|
}
|
||||||
36
system/disko/default.nix
Normal file
36
system/disko/default.nix
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
{ config, lib, devices, ... }: {
|
||||||
|
|
||||||
|
options = {
|
||||||
|
disko = {
|
||||||
|
enable = lib.options.mkOption {
|
||||||
|
default = false;
|
||||||
|
type = lib.types.bool;
|
||||||
|
};
|
||||||
|
impermanent = lib.options.mkOption {
|
||||||
|
default = false;
|
||||||
|
type = lib.types.bool;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf config.disko.enable (lib.mkMerge [
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./disko.nix { device = devices.main; }
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
(lib.mkIf (devices.bonus != null) {
|
||||||
|
imports = [
|
||||||
|
(./disko_bonus.nix { devices = devices.bonus; })
|
||||||
|
];
|
||||||
|
})
|
||||||
|
|
||||||
|
(lib.mkIf config.disko.impermanent {
|
||||||
|
imports = [
|
||||||
|
./impermanent.nix
|
||||||
|
];
|
||||||
|
})
|
||||||
|
]);
|
||||||
|
}
|
||||||
72
system/disko/disko.nix
Normal file
72
system/disko/disko.nix
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
{ device ? throw "Set this to your device e.g. /dev/sda", ... }: {
|
||||||
|
|
||||||
|
disko.devices = {
|
||||||
|
disk.main = {
|
||||||
|
inherit device;
|
||||||
|
type = "disk";
|
||||||
|
content = {
|
||||||
|
type = "gpt";
|
||||||
|
partitions = {
|
||||||
|
boot = {
|
||||||
|
name = "boot";
|
||||||
|
size = "1M";
|
||||||
|
type = "EF02";
|
||||||
|
};
|
||||||
|
esp = {
|
||||||
|
name = "ESP";
|
||||||
|
size = "500M";
|
||||||
|
type = "EF00";
|
||||||
|
content = {
|
||||||
|
type = "filesystem";
|
||||||
|
format = "vfat";
|
||||||
|
mountpoint = "/boot";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
swap = {
|
||||||
|
size = "4G";
|
||||||
|
content = {
|
||||||
|
type = "swap";
|
||||||
|
resumeDevice = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
root = {
|
||||||
|
name = "root";
|
||||||
|
size = "100%";
|
||||||
|
content = {
|
||||||
|
type = "lvm_pv";
|
||||||
|
vg = "root_vg";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
lvm_vg = {
|
||||||
|
root_vg = {
|
||||||
|
type = "lvm_vg";
|
||||||
|
lvs = {
|
||||||
|
root = {
|
||||||
|
size = "100%FREE";
|
||||||
|
content = {
|
||||||
|
type = "btrfs";
|
||||||
|
extraArgs = [ "-f" ];
|
||||||
|
subvolumes = {
|
||||||
|
"/root" = {
|
||||||
|
mountpoint = "/";
|
||||||
|
};
|
||||||
|
"/persist" = {
|
||||||
|
mountOptions = [ "subvol=persist" "noatime" ];
|
||||||
|
mountpoint = "/persist";
|
||||||
|
};
|
||||||
|
"/nix" = {
|
||||||
|
mountOptions = [ "subvol=nix" "noatime" ];
|
||||||
|
mountpoint = "/nix";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
43
system/disko/disko_bonus.nix
Normal file
43
system/disko/disko_bonus.nix
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
{ devices ? throw "Set this to an attribute set of your devices e.g. { disk1 = \"/dev/sda\"; }", ... }: {
|
||||||
|
|
||||||
|
disko.devices = builtins.mapAttrs (name: device: {
|
||||||
|
disk.${name} = {
|
||||||
|
inherit device;
|
||||||
|
type = "disk";
|
||||||
|
content = {
|
||||||
|
type = "gpt";
|
||||||
|
partitions = {
|
||||||
|
${name} = {
|
||||||
|
name = "${name}";
|
||||||
|
size = "100%";
|
||||||
|
content = {
|
||||||
|
type = "lvm_pv";
|
||||||
|
vg = "$name_vg";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
lvm_vg = {
|
||||||
|
"${name}_vg" = {
|
||||||
|
type = "lvm_vg";
|
||||||
|
lvs = {
|
||||||
|
${name} = {
|
||||||
|
size = "100%FREE";
|
||||||
|
content = {
|
||||||
|
type = "btrfs";
|
||||||
|
extraArgs = [ "-f" ];
|
||||||
|
subvolumes = {
|
||||||
|
"/${name}" = {
|
||||||
|
mountOptions = [ "subvol=${name}" "noatime" ];
|
||||||
|
mountpoint = "/${name}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}) devices;
|
||||||
|
}
|
||||||
19
system/disko/flake.nix
Normal file
19
system/disko/flake.nix
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
description = "disko config";
|
||||||
|
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
|
||||||
|
disko.url = "github:nix-community/disko";
|
||||||
|
disko.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs = { ... }@inputs: {
|
||||||
|
|
||||||
|
module = { config, lib, pkgs, devices, ... }: {
|
||||||
|
imports = [
|
||||||
|
(./default.nix { inherit devices; })
|
||||||
|
inputs.disko.nixosModules.default
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
29
system/disko/impermanent.nix
Normal file
29
system/disko/impermanent.nix
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
{ config, lib, ... }: {
|
||||||
|
|
||||||
|
boot.initrd.postDeviceCommands = lib.mkAfter ''
|
||||||
|
mkdir /btrfs_tmp
|
||||||
|
mount /dev/root_vg/root /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
|
||||||
|
|
||||||
|
deleteSubvolumeRecursively() {
|
||||||
|
IFS=$'\n'
|
||||||
|
for i in $(btrfs subvolume list -o "$1" | cut -f 9- -d ' '); do
|
||||||
|
deleteSubvolumeRecursively "/btrfs_tmp/$i"
|
||||||
|
done;
|
||||||
|
btrfs subvolume delete $1
|
||||||
|
}
|
||||||
|
|
||||||
|
for i in $(find /btrfs_tmp/old_roots -maxdepth 1 -mtime +30); do
|
||||||
|
deleteSubvolumeRecursively "$i"
|
||||||
|
done
|
||||||
|
|
||||||
|
btrfs subvolume create /btrfs_tmp/root
|
||||||
|
umount /btrfs_tmp
|
||||||
|
'';
|
||||||
|
|
||||||
|
config.initialPasswords = lib.mkForce true;
|
||||||
|
}
|
||||||
@@ -11,6 +11,10 @@
|
|||||||
|
|
||||||
prgms.url = "./programs";
|
prgms.url = "./programs";
|
||||||
|
|
||||||
|
disko.url = "./disko";
|
||||||
|
|
||||||
|
impermanence.url = "./impermanence";
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, ... }@inputs: {
|
outputs = { self, ... }@inputs: {
|
||||||
@@ -18,6 +22,8 @@
|
|||||||
nixosModule = { config, lib, pkgs, core_inputs, ... }: {
|
nixosModule = { config, lib, pkgs, core_inputs, ... }: {
|
||||||
imports = [
|
imports = [
|
||||||
./configuration/configuration.nix
|
./configuration/configuration.nix
|
||||||
|
inputs.disko.module
|
||||||
|
inputs.impermanence.module
|
||||||
inputs.sddm.module
|
inputs.sddm.module
|
||||||
inputs.srvcs.module
|
inputs.srvcs.module
|
||||||
inputs.pckgs.module
|
inputs.pckgs.module
|
||||||
|
|||||||
29
system/impermanence/default.nix
Normal file
29
system/impermanence/default.nix
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
{ config, lib, self, ... }: {
|
||||||
|
|
||||||
|
options = {};
|
||||||
|
|
||||||
|
config = lib.mkIf config.disko.impermanent {
|
||||||
|
imports = [
|
||||||
|
self.inputs.impermanence.nixosModules.impermanence
|
||||||
|
];
|
||||||
|
|
||||||
|
fileSystems."/persist".neededForBoot = true;
|
||||||
|
environment.persistence."/persist/system" = {
|
||||||
|
hideMounts = true;
|
||||||
|
directories = [
|
||||||
|
"/etc/nixos"
|
||||||
|
"/etc/shadow"
|
||||||
|
"/var/log"
|
||||||
|
"/var/lib/bluetooth"
|
||||||
|
"/var/lib/nixos"
|
||||||
|
"/var/lib/systemd/coredump"
|
||||||
|
"/etc/NetworkManager/system-connections"
|
||||||
|
];
|
||||||
|
files = [
|
||||||
|
"/etc/machine-id"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.fuse.userAllowOther = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
10
system/impermanence/flake.nix
Normal file
10
system/impermanence/flake.nix
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
description = "nix impermanence config";
|
||||||
|
|
||||||
|
inputs.impermanence.url = "github:nix-community/impermanence";
|
||||||
|
|
||||||
|
outputs = { self, ... }: {
|
||||||
|
|
||||||
|
module = import ./. { inherit self; };
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user