Simplify nixos-*
justfile recipes
Make the hostname configurable for NixOS and remove the need to specify the profile name when running `nixos-rebuild` commands as the hostname can be used.
This commit is contained in:
parent
a0b155ea8e
commit
5ebe064a28
|
@ -30,8 +30,8 @@
|
||||||
lib = import ./lib { inherit inputs; };
|
lib = import ./lib { inherit inputs; };
|
||||||
|
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
apollo = mkNixos { desktop = true; };
|
apollo = mkNixos { desktop = true; hostname = "apollo"; };
|
||||||
nixedo = mkNixos { desktop = true; };
|
nixedo = mkNixos { desktop = true; hostname = "nixedo"; };
|
||||||
};
|
};
|
||||||
|
|
||||||
homeConfigurations = { wsl2 = mkWsl; };
|
homeConfigurations = { wsl2 = mkWsl; };
|
||||||
|
|
8
justfile
8
justfile
|
@ -1,16 +1,18 @@
|
||||||
|
profile := `hostname`
|
||||||
|
|
||||||
_default:
|
_default:
|
||||||
just --list
|
just --list
|
||||||
|
|
||||||
check:
|
check:
|
||||||
nix flake check
|
nix flake check
|
||||||
|
|
||||||
nixos-build profile:
|
nixos-build:
|
||||||
sudo nixos-rebuild build --flake ".#{{ profile }}"
|
sudo nixos-rebuild build --flake ".#{{ profile }}"
|
||||||
|
|
||||||
nixos-switch profile:
|
nixos-switch:
|
||||||
sudo nixos-rebuild switch --flake ".#{{ profile }}"
|
sudo nixos-rebuild switch --flake ".#{{ profile }}"
|
||||||
|
|
||||||
nixos-test profile:
|
nixos-test:
|
||||||
sudo nixos-rebuild test --flake ".#{{ profile }}"
|
sudo nixos-rebuild test --flake ".#{{ profile }}"
|
||||||
|
|
||||||
update:
|
update:
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ inputs, desktop ? false, self, }:
|
{ inputs, desktop ? false, hostname, self }:
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
let
|
let
|
||||||
configure-gtk = pkgs.writeTextFile {
|
configure-gtk = pkgs.writeTextFile {
|
||||||
|
@ -30,7 +30,8 @@ in {
|
||||||
DefaultTimeoutStopSec=10s
|
DefaultTimeoutStopSec=10s
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# networking.hostName = hostname;
|
networking.hostName = hostname;
|
||||||
|
|
||||||
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
||||||
|
|
||||||
# Configure network proxy if necessary
|
# Configure network proxy if necessary
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{ inputs, self, username, }:
|
{ inputs, self, username }:
|
||||||
{ desktop ? false, }:
|
{ desktop ? false, hostname }:
|
||||||
let
|
let
|
||||||
configuration = import ./configuration.nix { inherit desktop inputs self; };
|
configuration = import ./configuration.nix { inherit desktop hostname inputs self; };
|
||||||
hardwareConfiguration = import ./hardware-configuration.nix;
|
hardwareConfiguration = import ./hardware-configuration.nix;
|
||||||
in inputs.nixpkgs.lib.nixosSystem {
|
in inputs.nixpkgs.lib.nixosSystem {
|
||||||
modules = [
|
modules = [
|
||||||
|
|
Loading…
Reference in a new issue