1
Fork 0

A lot of iso changes

This commit is contained in:
prescientmoon 2024-08-27 16:28:49 +02:00
parent 2b2e74a75d
commit b95a4e55c2
Signed by: prescientmoon
SSH key fingerprint: SHA256:WFp/cO76nbarETAoQcQXuV+0h7XJsEsOCI0UsyPIy6U
11 changed files with 105 additions and 74 deletions

View file

@ -151,7 +151,7 @@
imports = lib.lists.optionals (builtins.pathExists ./home/${hostname}.nix) [ imports = lib.lists.optionals (builtins.pathExists ./home/${hostname}.nix) [
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
{ {
home-manager.users.pilot = import ./home/${hostname}.nix; home-manager.users.pilot = ./home/${hostname}.nix;
home-manager.extraSpecialArgs = specialArgs system // { home-manager.extraSpecialArgs = specialArgs system // {
inherit hostname; inherit hostname;
}; };

View file

@ -67,7 +67,7 @@
{ {
name = "eDP-1"; name = "eDP-1";
width = 1920; width = 1920;
height = 1080; height = 1200;
} }
]; ];
}; };

View file

@ -10,14 +10,14 @@ let
# Toggles for including tooling related to a given language # Toggles for including tooling related to a given language
packedTargets = { packedTargets = {
elm = false; elm = false;
latex = !config.satellite.toggles.neovim-minimal.enable; latex = true;
lua = !config.satellite.toggles.neovim-minimal.enable; lua = true;
nix = true; nix = true;
purescript = false; purescript = false;
python = false; python = false;
rust = false; rust = false;
typst = !config.satellite.toggles.neovim-minimal.enable; typst = true;
web = !config.satellite.toggles.neovim-minimal.enable; web = true;
csharp = false; csharp = false;
}; };
@ -1699,7 +1699,6 @@ in
# {{{ Basic config # {{{ Basic config
# We want other modules to know that we are using neovim! # We want other modules to know that we are using neovim!
satellite.toggles.neovim.enable = true; satellite.toggles.neovim.enable = true;
satellite.toggles.neovim-minimal.enable = lib.mkDefault false;
# Link files in the appropriate places # Link files in the appropriate places
xdg.configFile.nvim.source = config.satellite.dev.path "home/features/neovim/config"; xdg.configFile.nvim.source = config.satellite.dev.path "home/features/neovim/config";
@ -1710,7 +1709,8 @@ in
home.packages = [ home.packages = [
neovim neovim
pkgs.vimclip pkgs.vimclip
] ++ lib.lists.optional (!config.satellite.toggles.neovim-minimal.enable) neovide; neovide
];
# }}} # }}}
# {{{ Persistence # {{{ Persistence
satellite.persistence.at.state.apps.neovim.directories = [ satellite.persistence.at.state.apps.neovim.directories = [

View file

@ -1,22 +1,30 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
# {{{ Imports
imports = [ imports = [
./global.nix ./global.nix
./features/desktop/foot.nix
./features/desktop/firefox
./features/cli/lazygit.nix ./features/cli/lazygit.nix
./features/desktop/foot.nix
./features/wayland/hyprland ./features/wayland/hyprland
./features/neovim
]; ];
# }}}
# {{{ Arbitrary extra packages
programs.firefox.enable = true;
# Arbitrary extra packages home.packages =
home.packages = with pkgs; [ let
sops # Secret editing cloneConfig = pkgs.writeShellScriptBin "liftoff" ''
]; git clone git@github.com:prescientmoon/everything-nix.git
cd everything-nix
'';
in
with pkgs;
[
sops # Secret editing
neovim # Text editor
cloneConfig # Clones my nixos config from github
];
# }}}
home.username = "moon";
home.stateVersion = "24.05"; home.stateVersion = "24.05";
satellite.toggles.neovim-minimal.enable = true;
} }

View file

@ -32,8 +32,9 @@
after = [ "systemd-cryptsetup@enc.service" ]; after = [ "systemd-cryptsetup@enc.service" ];
before = [ "sysroot.mount" ]; before = [ "sysroot.mount" ];
script = '' script = ''
btrfs subvolume delete /root ls /
btrfs subvolume snapshot /blank /root btrfs subvolume delete /
btrfs subvolume create /
''; '';
}; };
# }}} # }}}

View file

@ -34,11 +34,8 @@
extraArgs = [ "-f" ]; extraArgs = [ "-f" ];
subvolumes = { subvolumes = {
# {{{ /blank # {{{ /
"/blank" = { }; "root" = {
# }}}
# {{{ /root
"/root" = {
mountpoint = "/"; mountpoint = "/";
mountOptions = [ mountOptions = [
"compress=zstd" "compress=zstd"
@ -47,13 +44,13 @@
}; };
# }}} # }}}
# {{{ /swap # {{{ /swap
"/swap" = { "swap" = {
mountpoint = "/.swapvol"; mountpoint = "/.swapvol";
swap.swapfile.size = "20G"; swap.swapfile.size = "20G";
}; };
# }}} # }}}
# {{{ /root/persist/data # {{{ /persist/data
"/root/persist/data" = { "persist-data" = {
mountpoint = "/persist/data"; mountpoint = "/persist/data";
mountOptions = [ mountOptions = [
"compress=zstd" "compress=zstd"
@ -61,8 +58,8 @@
]; ];
}; };
# }}} # }}}
# {{{ /root/persist/state # {{{ /persist/state
"/root/persist/state" = { "persist-state" = {
mountpoint = "/persist/state"; mountpoint = "/persist/state";
mountOptions = [ mountOptions = [
"compress=zstd" "compress=zstd"
@ -70,8 +67,8 @@
]; ];
}; };
# }}} # }}}
# {{{ /root/local/nix # {{{ /local/nix
"/root/local/nix" = { "local-nix" = {
mountpoint = "/nix"; mountpoint = "/nix";
mountOptions = [ mountOptions = [
"compress=zstd" "compress=zstd"
@ -79,8 +76,8 @@
]; ];
}; };
# }}} # }}}
# {{{ /root/local/cache # {{{ /local/nix
"/root/local/cache" = { "local-cache" = {
mountpoint = "/persist/local/cache"; mountpoint = "/persist/local/cache";
mountOptions = [ mountOptions = [
"compress=zstd" "compress=zstd"

View file

@ -1,4 +1,10 @@
{ config, lib, ... }:
{ {
# Why is this not part of the nixos module...
systemd.tmpfiles.rules = lib.mapAttrsToList (
_: c: "Q ${c.SUBVOLUME}/.snapshots"
) config.services.snapper.configs;
services.snapper = { services.snapper = {
snapshotInterval = "hourly"; snapshotInterval = "hourly";
cleanupInterval = "1d"; cleanupInterval = "1d";

View file

@ -1,18 +1,20 @@
# See the wiki for more details https://wiki.nixos.org/wiki/Creating_a_NixOS_live_CD
#
# Can be built with
# nix build .#nixosConfigurations.iso.config.system.build.isoImage
{ modulesPath, lib, ... }: { modulesPath, lib, ... }:
{ {
# {{{ Imports
imports = [ imports = [
"${modulesPath}/installer/cd-dvd/installation-cd-minimal.nix" "${modulesPath}/installer/cd-dvd/installation-cd-minimal.nix"
../common/global ../common/global
../common/users/pilot.nix
../common/optional/desktop
../common/optional/wayland/hyprland.nix ../common/optional/wayland/hyprland.nix
../common/optional/services/kanata.nix
]; ];
# }}}
# Tell sops-nix to use the hermes keys for decrypting secrets
sops.age.sshKeyPaths = [ "/hermes/secrets/hermes/ssh_host_ed25519_key" ];
# Override tailscale service enabled by the `global/default.nix` file
services.tailscale.enable = lib.mkForce false;
# {{{ Automount hermes # {{{ Automount hermes
fileSystems."/hermes" = { fileSystems."/hermes" = {
device = "/dev/disk/by-uuid/7FE7-CA68"; device = "/dev/disk/by-uuid/7FE7-CA68";
@ -23,4 +25,16 @@
]; ];
}; };
# }}} # }}}
# Tell sops-nix to use the hermes keys for decrypting secrets
sops.age.sshKeyPaths = [ "/hermes/secrets/hermes/ssh_host_ed25519_key" ];
# Override tailscale service enabled by the `global/default.nix` file
services.tailscale.enable = lib.mkForce false;
# Fast but bad compression
# isoImage.squashfsCompression = "gzip -Xcompression-level 1";
# Set username
satellite.pilot.name = "moon";
} }

View file

@ -3,43 +3,46 @@
{ lib, ... }: { lib, ... }:
{ {
options.satellite.monitors = lib.mkOption { options.satellite.monitors = lib.mkOption {
type = lib.types.listOf (lib.types.submodule { default = [ ];
options = { type = lib.types.listOf (
name = lib.mkOption { lib.types.submodule {
type = lib.types.str; options = {
example = "DP-1"; name = lib.mkOption {
}; type = lib.types.str;
example = "DP-1";
};
width = lib.mkOption { width = lib.mkOption {
type = lib.types.int; type = lib.types.int;
example = 1920; example = 1920;
}; };
height = lib.mkOption { height = lib.mkOption {
type = lib.types.int; type = lib.types.int;
example = 1080; example = 1080;
}; };
refreshRate = lib.mkOption { refreshRate = lib.mkOption {
type = lib.types.int; type = lib.types.int;
default = 60; default = 60;
}; };
x = lib.mkOption { x = lib.mkOption {
type = lib.types.int; type = lib.types.int;
default = 0; default = 0;
}; };
y = lib.mkOption { y = lib.mkOption {
type = lib.types.int; type = lib.types.int;
default = 0; default = 0;
}; };
workspace = lib.mkOption { workspace = lib.mkOption {
type = lib.types.nullOr lib.types.str; type = lib.types.nullOr lib.types.str;
default = null; default = null;
};
}; };
}; }
}); );
}; };
} }

2
scripts/build-iso.sh Executable file
View file

@ -0,0 +1,2 @@
#!/usr/bin/env bash
nix build .#nixosConfigurations.iso.config.system.build.isoImage

View file

@ -47,7 +47,7 @@ if [ "$action" = "install" ]; then
> ./hosts/nixos/$host/hardware/generated.nix > ./hosts/nixos/$host/hardware/generated.nix
git add . git add .
echo "❄️ Installing nixos" echo "❄️ nstalling nixos"
nixos-install --flake ".#$host" nixos-install --flake ".#$host"
echo "🔑 Copying user ssh keys" echo "🔑 Copying user ssh keys"