From 74212cbd58285c0ca6780ea4d00f292c6af6e374 Mon Sep 17 00:00:00 2001 From: Chris Kruining Date: Thu, 31 Jul 2025 14:46:28 +0200 Subject: [PATCH] cleanup code --- README.md | 7 +++++ flake.lock | 22 +++++++++++++++ flake.nix | 8 ++++++ justfile | 29 ++++++++++++++++++++ modules/nixos/application/steam/default.nix | 6 ----- modules/nixos/boot/default.nix | 2 +- systems/x86_64-linux/melkor/README.md | 3 +++ systems/x86_64-linux/varda/README.md | 3 +++ systems/x86_64-linux/varda/default.nix | 30 +++++++++++++++++++++ systems/x86_64-linux/yavanna/README.md | 3 +++ 10 files changed, 106 insertions(+), 7 deletions(-) create mode 100644 README.md create mode 100644 justfile create mode 100644 systems/x86_64-linux/melkor/README.md create mode 100644 systems/x86_64-linux/varda/README.md create mode 100644 systems/x86_64-linux/varda/default.nix create mode 100644 systems/x86_64-linux/yavanna/README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..4924525 --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ + + +## Inpirations + +- [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 diff --git a/flake.lock b/flake.lock index 1c719cd..c0545f0 100644 --- a/flake.lock +++ b/flake.lock @@ -577,6 +577,27 @@ "type": "github" } }, + "nixos-wsl": { + "inputs": { + "flake-compat": [], + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1753704990, + "narHash": "sha256-5E14xuNWy2Un1nFR55k68hgbnD8U2x/rE5DXJtYKusw=", + "owner": "nix-community", + "repo": "nixos-wsl", + "rev": "58c814cc6d4a789191f9c12e18277107144b0c91", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixos-wsl", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1751186460, @@ -834,6 +855,7 @@ "jovian": "jovian", "nix-minecraft": "nix-minecraft", "nixos-boot": "nixos-boot", + "nixos-wsl": "nixos-wsl", "nixpkgs": "nixpkgs_6", "nvf": "nvf", "plasma-manager": "plasma-manager", diff --git a/flake.nix b/flake.nix index 63b5789..08e767a 100644 --- a/flake.nix +++ b/flake.nix @@ -62,6 +62,14 @@ grub2-themes = { url = "github:vinceliuice/grub2-themes"; }; + + nixos-wsl = { + url = "github:nix-community/nixos-wsl"; + inputs = { + nixpkgs.follows = "nixpkgs"; + flake-compat.follows = ""; + }; + }; }; outputs = inputs: inputs.snowfall-lib.mkFlake { diff --git a/justfile b/justfile new file mode 100644 index 0000000..e436695 --- /dev/null +++ b/justfile @@ -0,0 +1,29 @@ +default: + @just --list --unsorted + +flake := justfile_directory() +determinate-flags := "--option extra-substituters https://install.determinate.systems --option extra-trusted-public-keys cache.flakehub.com-3:hJuILl5sVK4iKm86JzgdXW12Y2Hwd5G07qKtHTOcDCM=" + +update *inputs: + nix flake update {{inputs}} + +update-all: + nix flake update + +build host: + nh os build {{flake}} -H {{host}} -- {{determinate-flags}} + +test: + nh os test {{flake}} -- {{determinate-flags}} + +switch: + nh os boot --ask {{flake}} -- {{determinate-flags}} + +prepare-deploy-ssh target: + ssh-copy-id {{target}} + +prepare-deploy-kexec target: (prepare-deploy-ssh target) + ssh {{target}} "(curl -L https://github.com/nix-community/nixos-images/releases/download/nixos-unstable/nixos-kexec-installer-noninteractive-x86_64-linux.tar.gz | tar -xzf- -C /root) && /root/kexec/run" + +deploy target hostname: (prepare-deploy-ssh target) + nix run github:nix-community/nixos-anywhere -- --flake '.#{{hostname}}' {{target}} \ No newline at end of file diff --git a/modules/nixos/application/steam/default.nix b/modules/nixos/application/steam/default.nix index 0bde133..6170e8a 100644 --- a/modules/nixos/application/steam/default.nix +++ b/modules/nixos/application/steam/default.nix @@ -10,12 +10,6 @@ in }; config = mkIf cfg.enable { - # home.packages = with pkgs; [ protonup ]; - - # home.sessionVariables = { - # STEAM_EXTRA_COMPAT_TOOLS_PATHS = "\${HOME}/.steam/root/compatibilitytools.d"; - # }; - programs = { steam = { enable = true; diff --git a/modules/nixos/boot/default.nix b/modules/nixos/boot/default.nix index 255d3d6..1f844d1 100644 --- a/modules/nixos/boot/default.nix +++ b/modules/nixos/boot/default.nix @@ -30,7 +30,7 @@ in loader = { systemd-boot.enable = false; - grub.enable = true; + grub.enable = mkDefault true; grub2-theme = { enable = true; diff --git a/systems/x86_64-linux/melkor/README.md b/systems/x86_64-linux/melkor/README.md new file mode 100644 index 0000000..a430921 --- /dev/null +++ b/systems/x86_64-linux/melkor/README.md @@ -0,0 +1,3 @@ +# Description + +TBD \ No newline at end of file diff --git a/systems/x86_64-linux/varda/README.md b/systems/x86_64-linux/varda/README.md new file mode 100644 index 0000000..2bff48a --- /dev/null +++ b/systems/x86_64-linux/varda/README.md @@ -0,0 +1,3 @@ +# Description + +Installer ISO \ No newline at end of file diff --git a/systems/x86_64-linux/varda/default.nix b/systems/x86_64-linux/varda/default.nix new file mode 100644 index 0000000..2aa8c22 --- /dev/null +++ b/systems/x86_64-linux/varda/default.nix @@ -0,0 +1,30 @@ +{ pkgs, ... }: +{ + imports = [ + "${pkgs}/nixos/modules/installer/cd-dvd/installation-cd-graphical-calamares-plasma6.nix" + "${pkgs}/nixos/modules/installer/cd-dvd/channel.nix" + ]; + + sneeuwvlok = { + services = { + networking.ssh.enable = true; + media.enable = true; + }; + + editor = { + nano.enable = true; + }; + }; + + boot = { + kernelPackages = pkgs.linuxPackages_latest; + supportedFilesystems = lib.mkForce ["btrfs" "reiserfs" "vfat" "f2fs" "xfs" "ntfs" "cifs"]; + }; + + services = { + qemuGuest.enable = true; + openssh.settings.PermitRootLogin = "yes"; + }; + + system.stateVersion = "23.11"; +} diff --git a/systems/x86_64-linux/yavanna/README.md b/systems/x86_64-linux/yavanna/README.md new file mode 100644 index 0000000..a430921 --- /dev/null +++ b/systems/x86_64-linux/yavanna/README.md @@ -0,0 +1,3 @@ +# Description + +TBD \ No newline at end of file