mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2025-12-06 09:07:21 +01:00
fix: adapt local installer script
This commit is contained in:
parent
b490763245
commit
4b439fd3e7
4 changed files with 27 additions and 78 deletions
|
|
@ -2859,7 +2859,7 @@ This is a slim setup for developing base configuration. I do not track the hardw
|
|||
swapSize = "2G";
|
||||
# rootDisk = "/dev/nvme0n1";
|
||||
rootDisk = "/dev/vda";
|
||||
profiles.btrfs = lib.mkIf minimal true;
|
||||
profiles.btrfs = true;
|
||||
# rootDisk = "/dev/vda";
|
||||
}
|
||||
sharedOptions;
|
||||
|
|
@ -3253,7 +3253,7 @@ I also set the =WLR_RENDERER_ALLOW_SOFTWARE=1= to allow this configuration to ru
|
|||
:END:
|
||||
|
||||
#+begin_src nix-ts :tangle hosts/nixos/chaostheatre/default.nix
|
||||
{ self, inputs, config, pkgs, lib, ... }:
|
||||
{ self, config, pkgs, lib, minimal, ... }:
|
||||
let
|
||||
mainUser = "demo";
|
||||
sharedOptions = {
|
||||
|
|
@ -3262,7 +3262,8 @@ I also set the =WLR_RENDERER_ALLOW_SOFTWARE=1= to allow this configuration to ru
|
|||
isLinux = true;
|
||||
isPublic = true;
|
||||
profiles = {
|
||||
chaostheatre = true;
|
||||
chaostheatre = lib.mkIf (!minimal) true;
|
||||
minimal = lib.mkIf minimal true;
|
||||
};
|
||||
};
|
||||
in
|
||||
|
|
@ -3274,15 +3275,6 @@ I also set the =WLR_RENDERER_ALLOW_SOFTWARE=1= to allow this configuration to ru
|
|||
{
|
||||
_module.args.diskDevice = config.swarselsystems.rootDisk;
|
||||
}
|
||||
"${self}/hosts/nixos/chaostheatre/options.nix"
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.users."${mainUser}".imports = [
|
||||
"${self}/modules/home/common/settings.nix"
|
||||
"${self}/hosts/nixos/chaostheatre/options-home.nix"
|
||||
"${self}/modules/home/common/sharedsetup.nix"
|
||||
];
|
||||
}
|
||||
];
|
||||
|
||||
environment.variables = {
|
||||
|
|
@ -3312,6 +3304,7 @@ I also set the =WLR_RENDERER_ALLOW_SOFTWARE=1= to allow this configuration to ru
|
|||
isSwap = true;
|
||||
swapSize = "4G";
|
||||
rootDisk = "/dev/vda";
|
||||
profiles.btrfs = true;
|
||||
}
|
||||
sharedOptions;
|
||||
|
||||
|
|
@ -15042,34 +15035,8 @@ Autoformatting always puts the =EOF= with indentation, which makes shfmt check f
|
|||
if [[ $local_keys != *"${pub_arr[1]}"* ]]; then
|
||||
yellow "The ssh key for this configuration is not available."
|
||||
green "Adjusting flake.nix so that the configuration is buildable ..."
|
||||
sed -i '/nix-secrets = {/,/^[[:space:]]*};/d' flake.nix
|
||||
sed -i '/vbc-nix = {/,/^[[:space:]]*};/d' flake.nix
|
||||
sed -i '/[[:space:]]*\/\/ (inputs.vbc-nix.overlays.default final prev)/d' overlays/default.nix
|
||||
rm modules/home/common/env.nix
|
||||
rm modules/home/common/gammastep.nix
|
||||
rm modules/home/common/git.nix
|
||||
rm modules/home/common/mail.nix
|
||||
rm modules/home/common/yubikey.nix
|
||||
rm modules/nixos/server/restic.nix
|
||||
rm hosts/nixos/sync/default.nix
|
||||
rm -rf modules/nixos/server
|
||||
rm -rf modules/home/server
|
||||
cat > hosts/nixos/chaostheatre/options-home.nix << EOF
|
||||
{ self, lib, ... }:
|
||||
{
|
||||
options = {
|
||||
swarselsystems = {
|
||||
modules = {
|
||||
yubikey = lib.mkEnableOption "dummy option for chaostheatre";
|
||||
env = lib.mkEnableOption "dummy option for chaostheatre";
|
||||
git = lib.mkEnableOption "dummy option for chaostheatre";
|
||||
mail = lib.mkEnableOption "dummy option for chaostheatre";
|
||||
gammastep = lib.mkEnableOption "dummy option for chaostheatre";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
EOF
|
||||
nix flake update vbc-nix
|
||||
git add .
|
||||
else
|
||||
|
|
@ -15144,10 +15111,20 @@ Autoformatting always puts the =EOF= with indentation, which makes shfmt check f
|
|||
sudo mkdir -p /root/.local/share/nix/
|
||||
printf '{\"extra-substituters\":{\"https://nix-community.cachix.org\":true,\"https://nix-community.cachix.org https://cache.ngi0.nixos.org/\":true},\"extra-trusted-public-keys\":{\"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=\":true,\"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs= cache.ngi0.nixos.org-1:KqH5CBLNSyX184S9BKZJo1LxrxJ9ltnY2uAs5c/f1MA=\":true}}' | sudo tee /root/.local/share/nix/trusted-settings.json > /dev/null
|
||||
green "Installing flake $target_config"
|
||||
sudo nixos-install --flake .#"$target_config"
|
||||
|
||||
store_path=$(nix build --no-link --print-out-paths .#nixosConfigurationsMinimal."$target_config".config.system.build.toplevel)
|
||||
green "Linking generation in bootloader"
|
||||
sudo "/run/current-system/sw/bin/nix-env --profile /nix/var/nix/profiles/system --set $store_path"
|
||||
green "Setting generation to activate upon next boot"
|
||||
sudo "$store_path/bin/switch-to-configuration boot"
|
||||
green "Installation finished! Reboot to see changes"
|
||||
|
||||
#+end_src
|
||||
|
||||
#+RESULTS:
|
||||
| trap: | undefined | signal: | exit | | | | |
|
||||
| [ | Babel | evaluation | exited | with | code | 1 | ] |
|
||||
|
||||
|
||||
|
||||
#+begin_src nix-ts :tangle pkgs/swarsel-install/default.nix
|
||||
|
|
|
|||
|
|
@ -92,34 +92,8 @@ cd .dotfiles
|
|||
if [[ $local_keys != *"${pub_arr[1]}"* ]]; then
|
||||
yellow "The ssh key for this configuration is not available."
|
||||
green "Adjusting flake.nix so that the configuration is buildable ..."
|
||||
sed -i '/nix-secrets = {/,/^[[:space:]]*};/d' flake.nix
|
||||
sed -i '/vbc-nix = {/,/^[[:space:]]*};/d' flake.nix
|
||||
sed -i '/[[:space:]]*\/\/ (inputs.vbc-nix.overlays.default final prev)/d' overlays/default.nix
|
||||
rm modules/home/common/env.nix
|
||||
rm modules/home/common/gammastep.nix
|
||||
rm modules/home/common/git.nix
|
||||
rm modules/home/common/mail.nix
|
||||
rm modules/home/common/yubikey.nix
|
||||
rm modules/nixos/server/restic.nix
|
||||
rm hosts/nixos/sync/default.nix
|
||||
rm -rf modules/nixos/server
|
||||
rm -rf modules/home/server
|
||||
cat > hosts/nixos/chaostheatre/options-home.nix << EOF
|
||||
{ self, lib, ... }:
|
||||
{
|
||||
options = {
|
||||
swarselsystems = {
|
||||
modules = {
|
||||
yubikey = lib.mkEnableOption "dummy option for chaostheatre";
|
||||
env = lib.mkEnableOption "dummy option for chaostheatre";
|
||||
git = lib.mkEnableOption "dummy option for chaostheatre";
|
||||
mail = lib.mkEnableOption "dummy option for chaostheatre";
|
||||
gammastep = lib.mkEnableOption "dummy option for chaostheatre";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
EOF
|
||||
nix flake update vbc-nix
|
||||
git add .
|
||||
else
|
||||
|
|
@ -194,5 +168,10 @@ git add /home/"$target_user"/.dotfiles/hosts/nixos/"$target_config"/hardware-con
|
|||
sudo mkdir -p /root/.local/share/nix/
|
||||
printf '{\"extra-substituters\":{\"https://nix-community.cachix.org\":true,\"https://nix-community.cachix.org https://cache.ngi0.nixos.org/\":true},\"extra-trusted-public-keys\":{\"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=\":true,\"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs= cache.ngi0.nixos.org-1:KqH5CBLNSyX184S9BKZJo1LxrxJ9ltnY2uAs5c/f1MA=\":true}}' | sudo tee /root/.local/share/nix/trusted-settings.json > /dev/null
|
||||
green "Installing flake $target_config"
|
||||
sudo nixos-install --flake .#"$target_config"
|
||||
|
||||
store_path=$(nix build --no-link --print-out-paths .#nixosConfigurationsMinimal."$target_config".config.system.build.toplevel)
|
||||
green "Linking generation in bootloader"
|
||||
sudo "/run/current-system/sw/bin/nix-env --profile /nix/var/nix/profiles/system --set $store_path"
|
||||
green "Setting generation to activate upon next boot"
|
||||
sudo "$store_path/bin/switch-to-configuration boot"
|
||||
green "Installation finished! Reboot to see changes"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{ self, inputs, config, pkgs, lib, ... }:
|
||||
{ self, config, pkgs, lib, minimal, ... }:
|
||||
let
|
||||
mainUser = "demo";
|
||||
sharedOptions = {
|
||||
|
|
@ -7,7 +7,8 @@ let
|
|||
isLinux = true;
|
||||
isPublic = true;
|
||||
profiles = {
|
||||
chaostheatre = true;
|
||||
chaostheatre = lib.mkIf (!minimal) true;
|
||||
minimal = lib.mkIf minimal true;
|
||||
};
|
||||
};
|
||||
in
|
||||
|
|
@ -19,15 +20,6 @@ in
|
|||
{
|
||||
_module.args.diskDevice = config.swarselsystems.rootDisk;
|
||||
}
|
||||
"${self}/hosts/nixos/chaostheatre/options.nix"
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.users."${mainUser}".imports = [
|
||||
"${self}/modules/home/common/settings.nix"
|
||||
"${self}/hosts/nixos/chaostheatre/options-home.nix"
|
||||
"${self}/modules/home/common/sharedsetup.nix"
|
||||
];
|
||||
}
|
||||
];
|
||||
|
||||
environment.variables = {
|
||||
|
|
@ -57,6 +49,7 @@ in
|
|||
isSwap = true;
|
||||
swapSize = "4G";
|
||||
rootDisk = "/dev/vda";
|
||||
profiles.btrfs = true;
|
||||
}
|
||||
sharedOptions;
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ in
|
|||
swapSize = "2G";
|
||||
# rootDisk = "/dev/nvme0n1";
|
||||
rootDisk = "/dev/vda";
|
||||
profiles.btrfs = lib.mkIf minimal true;
|
||||
profiles.btrfs = true;
|
||||
# rootDisk = "/dev/vda";
|
||||
}
|
||||
sharedOptions;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue