From 61cf99cb77edea94767cfbcca0c94fe8189e7dfc Mon Sep 17 00:00:00 2001 From: polsevev Date: Tue, 20 May 2025 22:27:12 +0200 Subject: [PATCH] Finished setup of another host --- nixos/deploy.sh | 2 +- nixos/hermes/configuration.nix | 2 +- nixos/hermes/disko-config.nix | 6 ++--- nixos/hermes/flake.lock | 49 ++++++++++++++++++++++++++++++++++ nixos/hermes/flake.nix | 8 +++++- 5 files changed, 60 insertions(+), 7 deletions(-) create mode 100644 nixos/hermes/flake.lock diff --git a/nixos/deploy.sh b/nixos/deploy.sh index 75e6e82..de1e505 100755 --- a/nixos/deploy.sh +++ b/nixos/deploy.sh @@ -1,5 +1,5 @@ #!/bin/bash -nixos-rebuild --impure --flake $(pwd)/$2#$2 --build-host $2@$1 --target-host $2@$1 --fast --use-remote-sudo switch +nixos-rebuild --impure --flake $(pwd)/$2#$2 --target-host $2@$1 --fast --use-remote-sudo switch diff --git a/nixos/hermes/configuration.nix b/nixos/hermes/configuration.nix index 025a050..43514df 100644 --- a/nixos/hermes/configuration.nix +++ b/nixos/hermes/configuration.nix @@ -74,7 +74,7 @@ security.sudo.wheelNeedsPassword = false; # Define a user account. Don't forget to set a password with ‘passwd’. - users.users.ares = { + users.users.hermes = { isNormalUser = true; extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. openssh.authorizedKeys.keys = [ diff --git a/nixos/hermes/disko-config.nix b/nixos/hermes/disko-config.nix index 2066a94..f410002 100644 --- a/nixos/hermes/disko-config.nix +++ b/nixos/hermes/disko-config.nix @@ -1,7 +1,7 @@ { disko.devices = { disk = { - vdb = { + disk0 = { type = "disk"; device = "/dev/sda"; content = { @@ -37,9 +37,7 @@ }; }; }; - }; - disk1 = { - vdb = { + disk1 = { type = "disk"; device = "/dev/nvme0n1"; content = { diff --git a/nixos/hermes/flake.lock b/nixos/hermes/flake.lock new file mode 100644 index 0000000..3e99f19 --- /dev/null +++ b/nixos/hermes/flake.lock @@ -0,0 +1,49 @@ +{ + "nodes": { + "disko": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1746728054, + "narHash": "sha256-eDoSOhxGEm2PykZFa/x9QG5eTH0MJdiJ9aR00VAofXE=", + "owner": "nix-community", + "repo": "disko", + "rev": "ff442f5d1425feb86344c028298548024f21256d", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "latest", + "repo": "disko", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1747676747, + "narHash": "sha256-LXkWBVqilgx7Pohwqu/ABxDVw+Cmi5/Mj2S2mpUH0Fw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "72841a4a8761d1aed92ef6169a636872c986c76d", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "disko": "disko", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/nixos/hermes/flake.nix b/nixos/hermes/flake.nix index ed3c12d..8dc1305 100644 --- a/nixos/hermes/flake.nix +++ b/nixos/hermes/flake.nix @@ -4,17 +4,23 @@ inputs = { # NixOS official package source, using the nixos-24.11 branch here nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11"; + disko = { + url = "github:nix-community/disko/latest"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; - outputs = { self, nixpkgs, ... }@inputs: { + outputs = { self, nixpkgs, disko, ... }@inputs: { # Please replace my-nixos with your hostname nixosConfigurations.hermes = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ # Import the previous configuration.nix we used, # so the old configuration file still takes effect + disko.nixosModules.disko ./configuration.nix ./disko-config.nix + ./hardware-configuration.nix ]; }; };