From 0f2f2a09f0c98b998ae67996adf2aba143af540d Mon Sep 17 00:00:00 2001 From: Chris Kruining Date: Thu, 31 Jul 2025 19:40:43 +0200 Subject: [PATCH] right, that makes sense --- LICENSE.md | 19 +++ README.md | 3 +- flake.nix | 5 - .../x86_64-install-iso/minimal/default.nix | 120 ++++++++++++++++++ systems/x86_64-linux/varda/README.md | 2 +- systems/x86_64-linux/varda/default.nix | 96 -------------- 6 files changed, 142 insertions(+), 103 deletions(-) create mode 100644 LICENSE.md create mode 100644 systems/x86_64-install-iso/minimal/default.nix delete mode 100644 systems/x86_64-linux/varda/default.nix diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..5626bcd --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,19 @@ +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or distribute this +software, either in source code form or as a compiled binary, for any purpose, +commercial or non-commercial, and by any means. + +In jurisdictions that recognize copyright laws, the author or authors of this +software dedicate any and all copyright interest in the software to the public +domain. We make this dedication for the benefit of the public at large and to +the detriment of our heirs and successors. We intend this dedication to be an +overt act of relinquishment in perpetuity of all present and future rights to +this software under copyright law. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md index af500c0..66ef62f 100644 --- a/README.md +++ b/README.md @@ -4,4 +4,5 @@ - [dafitt/dotfiles](https://github.com/dafitt/dotfiles/) - [khaneliman/khanelinix](https://github.com/khaneliman/khanelinix) -- [alex007sirois/nix-config](https://github.com/alex007sirois/nix-config) (justfile) \ No newline at end of file +- [alex007sirois/nix-config](https://github.com/alex007sirois/nix-config) (justfile) +- [hmajid2301/nixicle](https://gitlab.com/hmajid2301/nixicle) (the GOAT, he did what I am aiming for!) \ No newline at end of file diff --git a/flake.nix b/flake.nix index 3d518fb..08e767a 100644 --- a/flake.nix +++ b/flake.nix @@ -99,11 +99,6 @@ flux.overlays.default ]; - system.hosts.varda.modules = with inputs; [ - "${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-graphical-calamares-plasma6.nix" - "${nixpkgs}/nixos/modules/installer/cd-dvd/channel.nix" - ]; - homes.modules = with inputs; [ stylix.homeModules.stylix plasma-manager.homeManagerModules.plasma-manager diff --git a/systems/x86_64-install-iso/minimal/default.nix b/systems/x86_64-install-iso/minimal/default.nix new file mode 100644 index 0000000..f3ba5e1 --- /dev/null +++ b/systems/x86_64-install-iso/minimal/default.nix @@ -0,0 +1,120 @@ +{ pkgs, lib, ... }: +let + inherit (lib) mkForce; +in +{ + boot = { + supportedFilesystems = mkForce ["btrfs" "reiserfs" "vfat" "f2fs" "xfs" "ntfs" "cifs"]; + + loader.efi.canTouchEfiVariables = true; + }; + + networking = { + wireless.enable = true; + networkmanager.enable = true; + }; + + nix = { + enable = true; + extraOptions = "experimental-features = nix-command flakes"; + channel.enable = false; + + settings = { + experimental-features = [ "nix-command" "flakes" ]; + allowed-users = [ "@wheel" ]; + trusted-users = [ "@wheel" ]; + + auto-optimise-store = true; + connect-timeout = 5; + http-connections = 50; + log-lines = 50; # more log lines in case of error + min-free = 1 * (1024 * 1024 * 1024); # GiB # start garbage collector + max-free = 50 * (1024 * 1024 * 1024); # GiB # until + warn-dirty = false; + }; + }; + + services = { + ssh.enable = true; + qemuGuest.enable = true; + openssh.settings.PermitRootLogin = mkForce "yes"; + }; + + system.locale.enable = true; + + user = { + name = "nixos"; + initialPassword = "kaas"; + }; + + environment.systemPackages = with pkgs; [ + # sbctl + git + # gum + # ( + # writeShellScriptBin "rescue" '' + # #!/usr/bin/env bash + # set -euo pipefail + + # gum "device name" + + # sudo mkdir -p /mnt/{dev,proc,sys,boot} + # sudo mount -o bind /dev /mnt/dev + # sudo mount -o bind /proc /mnt/proc + # sudo mount -o bind /sys /mnt/sys + # sudo chroot /mnt /nix/var/nix/profiles/system/activate + # sudo chroot /mnt /run/current-system/sw/bin/bash + + # sudo mount /dev/vda1 /mnt/boot + # sudo cryptsetup open /dev/vda3 cryptroot + # sudo mount /dev/mapper/cryptroot /mnt/ + + # sudo nixos-enter + # '' + # ) + # ( + # writeShellScriptBin "nix_installer" + # '' + # #!/usr/bin/env bash + # set -euo pipefail + + # if [ "$(id -u)" -eq 0 ]; then + # echo "ERROR! $(basename "$0") should be run as a regular user" + # exit 1 + # fi + + # if [ ! -d "$HOME/github/sneeuwvlok/.git" ]; then + # git clone https://github.com/chris-kruining/sneeuwvlok.git "$HOME/github/sneeuwvlok" + # fi + + # TARGET_HOST=$(ls -1 ~/github/sneeuwvlok/systems/*/default.nix | cut -d'/' -f6 | grep -v iso | gum choose) + + # if [ ! -e "$HOME/github/sneeuwvlok/hosts/$TARGET_HOST/disks.nix" ]; then + # echo "ERROR! $(basename "$0") could not find the required $HOME/github/sneeuwvlok/hosts/$TARGET_HOST/disks.nix" + # exit 1 + # fi + + # gum confirm --default=false \ + # "🔥 🔥 🔥 WARNING!!!! This will ERASE ALL DATA on the disk $TARGET_HOST. Are you sure you want to continue?" + + # echo "Partitioning Disks" + # sudo nix run github:nix-community/disko \ + # --extra-experimental-features "nix-command flakes" \ + # --no-write-lock-file \ + # -- \ + # --mode zap_create_mount \ + # "$HOME/dotfiles/hosts/$TARGET_HOST/disks.nix" + + # #echo "Creating blank volume" + # #sudo btrfs subvolume snapshot -r /mnt/ /mnt/root-blank + + # #echo "Set up attic binary cache" + # #attic use prod || true + + # sudo nixos-install --flake "$HOME/dotfiles#$TARGET_HOST" + # '' + # ) + ]; + + system.stateVersion = "23.11"; +} diff --git a/systems/x86_64-linux/varda/README.md b/systems/x86_64-linux/varda/README.md index 2bff48a..a430921 100644 --- a/systems/x86_64-linux/varda/README.md +++ b/systems/x86_64-linux/varda/README.md @@ -1,3 +1,3 @@ # Description -Installer ISO \ No newline at end of file +TBD \ No newline at end of file diff --git a/systems/x86_64-linux/varda/default.nix b/systems/x86_64-linux/varda/default.nix deleted file mode 100644 index 557d8f1..0000000 --- a/systems/x86_64-linux/varda/default.nix +++ /dev/null @@ -1,96 +0,0 @@ -{ pkgs, lib, ... }: -let - inherit (lib) mkForce; -in -{ - sneeuwvlok = { - services = { - networking.ssh.enable = true; - media.enable = true; - }; - - editor = { - nano.enable = true; - }; - }; - - boot = { - supportedFilesystems = mkForce ["btrfs" "reiserfs" "vfat" "f2fs" "xfs" "ntfs" "cifs"]; - }; - - services = { - qemuGuest.enable = true; - openssh.settings.PermitRootLogin = mkForce "yes"; - }; - - environment.systemPackages = with pkgs; [ - # sbctl - git - gum - ( - writeShellScriptBin "rescue" '' - #!/usr/bin/env bash - set -euo pipefail - - gum "device name" - - sudo mkdir -p /mnt/{dev,proc,sys,boot} - sudo mount -o bind /dev /mnt/dev - sudo mount -o bind /proc /mnt/proc - sudo mount -o bind /sys /mnt/sys - sudo chroot /mnt /nix/var/nix/profiles/system/activate - sudo chroot /mnt /run/current-system/sw/bin/bash - - sudo mount /dev/vda1 /mnt/boot - sudo cryptsetup open /dev/vda3 cryptroot - sudo mount /dev/mapper/cryptroot /mnt/ - - sudo nixos-enter - '' - ) - ( - writeShellScriptBin "nix_installer" - '' - #!/usr/bin/env bash - set -euo pipefail - - if [ "$(id -u)" -eq 0 ]; then - echo "ERROR! $(basename "$0") should be run as a regular user" - exit 1 - fi - - if [ ! -d "$HOME/github/sneeuwvlok/.git" ]; then - git clone https://github.com/chris-kruining/sneeuwvlok.git "$HOME/github/sneeuwvlok" - fi - - TARGET_HOST=$(ls -1 ~/github/sneeuwvlok/systems/*/default.nix | cut -d'/' -f6 | grep -v iso | gum choose) - - if [ ! -e "$HOME/github/sneeuwvlok/hosts/$TARGET_HOST/disks.nix" ]; then - echo "ERROR! $(basename "$0") could not find the required $HOME/github/sneeuwvlok/hosts/$TARGET_HOST/disks.nix" - exit 1 - fi - - gum confirm --default=false \ - "🔥 🔥 🔥 WARNING!!!! This will ERASE ALL DATA on the disk $TARGET_HOST. Are you sure you want to continue?" - - echo "Partitioning Disks" - sudo nix run github:nix-community/disko \ - --extra-experimental-features "nix-command flakes" \ - --no-write-lock-file \ - -- \ - --mode zap_create_mount \ - "$HOME/dotfiles/hosts/$TARGET_HOST/disks.nix" - - #echo "Creating blank volume" - #sudo btrfs subvolume snapshot -r /mnt/ /mnt/root-blank - - #echo "Set up attic binary cache" - #attic use prod || true - - sudo nixos-install --flake "$HOME/dotfiles#$TARGET_HOST" - '' - ) - ]; - - system.stateVersion = "23.11"; -}