From 34d2fc8379752ba3e55075fcec44118e00a54595 Mon Sep 17 00:00:00 2001 From: Jacob Babor Date: Sun, 3 May 2026 01:58:20 -0500 Subject: [PATCH] Flake? Flake --- base/system.nix | 5 +++-- flake.nix | 19 +++++++++++++++++++ pull-and-switch.sh | 3 ++- 3 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 flake.nix diff --git a/base/system.nix b/base/system.nix index 467be10..4afbce0 100644 --- a/base/system.nix +++ b/base/system.nix @@ -5,13 +5,14 @@ { config, lib, pkgs, ... }: { + # Enable the modern Nix CLI and flakes for reproducible system rebuilds. + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + # Use the systemd-boot EFI boot loader. boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; # Latest kernel, not LTS boot.kernelPackages = pkgs.linuxPackages_latest; - # TODO: Dynamically configure hostname - networking.hostName = "laptop-nixos-1"; # Configure network connections interactively with nmcli or nmtui. networking.networkmanager.enable = true; # Set your time zone. diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..8e9e139 --- /dev/null +++ b/flake.nix @@ -0,0 +1,19 @@ +{ + description = "Salt's NixOS configuration"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + }; + + outputs = { nixpkgs, ... }: { + nixosConfigurations.laptop-nixos-1 = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ./configuration.nix + { + networking.hostName = "laptop-nixos-1" + } + ]; + }; + }; +} diff --git a/pull-and-switch.sh b/pull-and-switch.sh index b97ae13..8d21b98 100755 --- a/pull-and-switch.sh +++ b/pull-and-switch.sh @@ -1,3 +1,4 @@ #!/bin/sh git pull -exec sudo nixos-rebuild switch +NIX_CONFIG='experimental-features = nix-command flakes' nix flake lock +exec sudo env NIX_CONFIG='experimental-features = nix-command flakes' nixos-rebuild switch --flake .#laptop-nixos-1