added installer config to flake.nix
This commit is contained in:
163
flake.nix
163
flake.nix
@@ -1,90 +1,99 @@
|
|||||||
{
|
{
|
||||||
description = "pagedMov's NixOS configuration";
|
description = "pagedMov's NixOS configuration";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
nur.url = "github:nix-community/NUR";
|
nur.url = "github:nix-community/NUR";
|
||||||
home-manager = {
|
home-manager = {
|
||||||
url = "github:nix-community/home-manager";
|
url = "github:nix-community/home-manager";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
hypr-contrib.url = "github:hyprwm/contrib";
|
hypr-contrib.url = "github:hyprwm/contrib";
|
||||||
hyprpicker.url = "github:hyprwm/hyprpicker";
|
hyprpicker.url = "github:hyprwm/hyprpicker";
|
||||||
hyprland = {
|
hyprland = {
|
||||||
type = "git";
|
type = "git";
|
||||||
url = "https://github.com/hyprwm/Hyprland";
|
url = "https://github.com/hyprwm/Hyprland";
|
||||||
submodules = true;
|
submodules = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
catppuccin-bat = {
|
catppuccin-bat = {
|
||||||
url = "github:catppuccin/bat";
|
url = "github:catppuccin/bat";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
catppuccin-cava = {
|
catppuccin-cava = {
|
||||||
url = "github:catppuccin/cava";
|
url = "github:catppuccin/cava";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
catppuccin-starship = {
|
catppuccin-starship = {
|
||||||
url = "github:catppuccin/starship";
|
url = "github:catppuccin/starship";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
catppuccin-yazi = {
|
catppuccin-yazi = {
|
||||||
url = "github:catppuccin/yazi";
|
url = "github:catppuccin/yazi";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
spicetify-nix = {
|
spicetify-nix = {
|
||||||
url = "github:gerg-l/spicetify-nix";
|
url = "github:gerg-l/spicetify-nix";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
nvim = {
|
nvim = {
|
||||||
url = "github:pagedMov/pagedmov-nixvim";
|
url = "github:pagedMov/pagedmov-nixvim";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
#glasshouse-desktop dots
|
#glasshouse-desktop dots
|
||||||
toilet = {
|
toilet = {
|
||||||
url = "github:pagedMov/toilet-extra-fonts";
|
url = "github:pagedMov/toilet-extra-fonts";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = {
|
outputs = {
|
||||||
nixpkgs,
|
nixpkgs,
|
||||||
nur,
|
nur,
|
||||||
home-manager,
|
home-manager,
|
||||||
self,
|
self,
|
||||||
nvim,
|
nvim,
|
||||||
toilet,
|
toilet,
|
||||||
...
|
...
|
||||||
} @ inputs: let
|
} @ inputs: let
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
username = "pagedmov";
|
username = "pagedmov";
|
||||||
in {
|
in {
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
desktop = nixpkgs.lib.nixosSystem {
|
desktop = nixpkgs.lib.nixosSystem {
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
host = "desktop";
|
host = "desktop";
|
||||||
inherit self inputs username;
|
inherit self inputs username;
|
||||||
};
|
};
|
||||||
inherit system;
|
inherit system;
|
||||||
modules = [
|
modules = [
|
||||||
./hosts/desktop
|
./hosts/desktop
|
||||||
nur.nixosModules.nur
|
nur.nixosModules.nur
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
laptop = nixpkgs.lib.nixosSystem {
|
||||||
laptop = nixpkgs.lib.nixosSystem {
|
specialArgs = {
|
||||||
specialArgs = {
|
host = "laptop";
|
||||||
host = "laptop";
|
inherit self inputs username;
|
||||||
inherit self inputs username;
|
};
|
||||||
};
|
modules = [
|
||||||
modules = [
|
./hosts/laptop
|
||||||
./hosts/laptop
|
nur.nixosModules.nur
|
||||||
nur.nixosModules.nur
|
];
|
||||||
];
|
};
|
||||||
};
|
installer = nixpkgs.lib.nixosSystem {
|
||||||
};
|
specialArgs = {
|
||||||
};
|
host = "installer";
|
||||||
|
inherit self inputs;
|
||||||
|
};
|
||||||
|
modules = [
|
||||||
|
./hosts/installer
|
||||||
|
inputs.disko.nixosModules.default
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,17 +13,20 @@ let
|
|||||||
rm -rf ./*
|
rm -rf ./*
|
||||||
|
|
||||||
# download disko.nix file for defining partitions
|
# download disko.nix file for defining partitions
|
||||||
echo "Downloading partition map... "
|
echo -n "Downloading partition plan..."
|
||||||
curl https://raw.githubusercontent.com/vimjoyer/impermanent-setup/main/final/disko.nix > disko.nix
|
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
|
||||||
echo "This script is about to format and partition a hard drive."
|
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"
|
echo -e "\033[4;31mThis process is irreversible and will destroy all data on the drive.\033[0m"
|
||||||
sleep 2
|
sleep 2.5
|
||||||
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."
|
echo "Make absolutely sure that you know which drive you are choosing."
|
||||||
sleep 2
|
sleep 2.5
|
||||||
|
echo
|
||||||
|
lsblk -d -o NAME,SIZE
|
||||||
|
echo
|
||||||
echo -n "Which drive do you wish to sacrifice? "
|
echo -n "Which drive do you wish to sacrifice? "
|
||||||
read -r drive
|
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\""
|
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
|
# 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
|
mkdir -p /mnt/etc
|
||||||
cd /mnt/etc/
|
cd /mnt/etc/
|
||||||
git clone https://github.com/pagedMov/pagedmov-nix-cfg.git ./nixos
|
git clone https://github.com/pagedMov/pagedmov-nix-cfg.git ./nixos
|
||||||
@@ -43,18 +45,19 @@ let
|
|||||||
echo "Beginning secondary installation phase... "
|
echo "Beginning secondary installation phase... "
|
||||||
echo
|
echo
|
||||||
|
|
||||||
cp -r /mnt/etc/nixos /mnt/persist/home/.sysflake
|
cp -r /mnt/etc/nixos /mnt/home/pagedmov/.sysflake
|
||||||
rm -rf /mnt/etc/nixos/*
|
chown -R pagedmov /mnt/home/pagedmov/.sysflake
|
||||||
|
rm -rf /mnt/etc/nixos
|
||||||
|
ln -s /mnt/home/pagedmov/.sysflake /etc/nixos
|
||||||
|
|
||||||
nixos-enter <<EOF
|
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
|
NIXOS_SWITCH_USE_DIRTY_ENV=1 nixos-rebuild boot --flake /persist/home/.sysflake#mercury
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
echo "INSTALLATION COMPLETE ! !" | toilet -f 3d -w 120 | lolcat -a -s 180
|
echo "INSTALLATION COMPLETE ! !" | toilet -f 3d -w 120 | lolcat -a -s 180
|
||||||
echo "You can now reboot into your new system."
|
echo "You can now reboot into your new system."
|
||||||
echo "The system configuration flake will be found in your home folder under .sysflake"
|
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
|
in
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user