added installer config to flake.nix

This commit is contained in:
pagedmov
2024-10-17 20:18:39 -04:00
parent a2f4e74716
commit e6b3c2a495
2 changed files with 101 additions and 89 deletions

163
flake.nix
View File

@@ -1,90 +1,99 @@
{
description = "pagedMov's NixOS configuration";
description = "pagedMov's NixOS configuration";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nur.url = "github:nix-community/NUR";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nur.url = "github:nix-community/NUR";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
hypr-contrib.url = "github:hyprwm/contrib";
hyprpicker.url = "github:hyprwm/hyprpicker";
hyprland = {
type = "git";
url = "https://github.com/hyprwm/Hyprland";
submodules = true;
};
hypr-contrib.url = "github:hyprwm/contrib";
hyprpicker.url = "github:hyprwm/hyprpicker";
hyprland = {
type = "git";
url = "https://github.com/hyprwm/Hyprland";
submodules = true;
};
catppuccin-bat = {
url = "github:catppuccin/bat";
flake = false;
};
catppuccin-cava = {
url = "github:catppuccin/cava";
flake = false;
};
catppuccin-starship = {
url = "github:catppuccin/starship";
flake = false;
};
catppuccin-yazi = {
url = "github:catppuccin/yazi";
flake = false;
};
spicetify-nix = {
url = "github:gerg-l/spicetify-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
catppuccin-bat = {
url = "github:catppuccin/bat";
flake = false;
};
catppuccin-cava = {
url = "github:catppuccin/cava";
flake = false;
};
catppuccin-starship = {
url = "github:catppuccin/starship";
flake = false;
};
catppuccin-yazi = {
url = "github:catppuccin/yazi";
flake = false;
};
spicetify-nix = {
url = "github:gerg-l/spicetify-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
nvim = {
url = "github:pagedMov/pagedmov-nixvim";
inputs.nixpkgs.follows = "nixpkgs";
inputs.nixpkgs.follows = "nixpkgs";
};
#glasshouse-desktop dots
toilet = {
#glasshouse-desktop dots
toilet = {
url = "github:pagedMov/toilet-extra-fonts";
inputs.nixpkgs.follows = "nixpkgs";
inputs.nixpkgs.follows = "nixpkgs";
};
};
};
outputs = {
nixpkgs,
nur,
home-manager,
self,
nvim,
toilet,
...
} @ inputs: let
system = "x86_64-linux";
username = "pagedmov";
in {
nixosConfigurations = {
desktop = nixpkgs.lib.nixosSystem {
specialArgs = {
host = "desktop";
inherit self inputs username;
};
inherit system;
modules = [
./hosts/desktop
nur.nixosModules.nur
];
};
laptop = nixpkgs.lib.nixosSystem {
specialArgs = {
host = "laptop";
inherit self inputs username;
};
modules = [
./hosts/laptop
nur.nixosModules.nur
];
};
};
};
outputs = {
nixpkgs,
nur,
home-manager,
self,
nvim,
toilet,
...
} @ inputs: let
system = "x86_64-linux";
username = "pagedmov";
in {
nixosConfigurations = {
desktop = nixpkgs.lib.nixosSystem {
specialArgs = {
host = "desktop";
inherit self inputs username;
};
inherit system;
modules = [
./hosts/desktop
nur.nixosModules.nur
];
};
laptop = nixpkgs.lib.nixosSystem {
specialArgs = {
host = "laptop";
inherit self inputs username;
};
modules = [
./hosts/laptop
nur.nixosModules.nur
];
};
installer = nixpkgs.lib.nixosSystem {
specialArgs = {
host = "installer";
inherit self inputs;
};
modules = [
./hosts/installer
inputs.disko.nixosModules.default
];
};
};
};
}

View File

@@ -13,17 +13,20 @@ let
rm -rf ./*
# download disko.nix file for defining partitions
echo "Downloading partition map... "
curl https://raw.githubusercontent.com/vimjoyer/impermanent-setup/main/final/disko.nix > disko.nix
echo -n "Downloading partition plan..."
curl -s https://raw.githubusercontent.com/pagedMov/pagedmov-nix-cfg/refs/heads/master/hosts/installer/disko-ext4-singledisk.nix > disko.nix
echo "Done!"
lsblk -d -o NAME,SIZE
echo
echo "This script is about to format and partition a hard drive."
sleep 2
sleep 2.5
echo -e "\033[4;31mThis process is irreversible and will destroy all data on the drive.\033[0m"
sleep 2
echo "Make absolutely sure that you know which drive you are choosing. Abort with Ctrl+C if you aren't sure which one to use."
sleep 2
sleep 2.5
echo "Make absolutely sure that you know which drive you are choosing."
sleep 2.5
echo
lsblk -d -o NAME,SIZE
echo
echo -n "Which drive do you wish to sacrifice? "
read -r drive
@@ -31,7 +34,6 @@ let
nix --experimental-features "nix-command flakes" run github:nix-community/disko -- --mode disko /tmp/install_pwd/disko.nix --arg device "\"/dev/$drive\""
# set up home directory in /mnt/persist, create /persist/etc/nixos, cd to /etc/nixos and install my flake config
mkdir -p /mnt/persist/{etc/nixos,home}
mkdir -p /mnt/etc
cd /mnt/etc/
git clone https://github.com/pagedMov/pagedmov-nix-cfg.git ./nixos
@@ -43,18 +45,19 @@ let
echo "Beginning secondary installation phase... "
echo
cp -r /mnt/etc/nixos /mnt/persist/home/.sysflake
rm -rf /mnt/etc/nixos/*
cp -r /mnt/etc/nixos /mnt/home/pagedmov/.sysflake
chown -R pagedmov /mnt/home/pagedmov/.sysflake
rm -rf /mnt/etc/nixos
ln -s /mnt/home/pagedmov/.sysflake /etc/nixos
nixos-enter <<EOF
chmod -R 770 /persist
chown -R :persist /persist
NIXOS_SWITCH_USE_DIRTY_ENV=1 nixos-rebuild boot --flake /persist/home/.sysflake#mercury
EOF
echo "INSTALLATION COMPLETE ! !" | toilet -f 3d -w 120 | lolcat -a -s 180
echo "You can now reboot into your new system."
echo "The system configuration flake will be found in your home folder under .sysflake"
echo "/etc/nixos is a symlink leading to the .sysflake folder"
'';
in
{