Testing updated autoinstall script

This commit is contained in:
Emmet 2024-03-08 07:29:53 -06:00
parent 069e6efd08
commit 6f3bb3cca5

243
flake.nix
View file

@ -1,96 +1,110 @@
{ {
description = "Flake of LibrePhoenix"; description = "Flake of LibrePhoenix";
outputs = inputs@{ self, nixpkgs, nixpkgs-stable, home-manager, nix-doom-emacs, nix-straight, outputs = inputs@{ self, nixpkgs, nixpkgs-stable, home-manager, nix-doom-emacs
stylix, blocklist-hosts, rust-overlay, hyprland-plugins, , nix-straight, stylix, blocklist-hosts, rust-overlay, hyprland-plugins, eaf
eaf, eaf-browser, org-nursery, org-yaap, , eaf-browser, org-nursery, org-yaap, org-side-tree, org-timeblock, phscroll
org-side-tree, org-timeblock, phscroll, ... }: , ... }:
let let
# ---- SYSTEM SETTINGS ---- # # ---- SYSTEM SETTINGS ---- #
systemSettings = { systemSettings = {
system = "x86_64-linux"; # system arch system = "x86_64-linux"; # system arch
hostname = "snowfire"; # hostname hostname = "snowfire"; # hostname
profile = "personal"; # select a profile defined from my profiles directory profile =
timezone = "America/Chicago"; # select timezone "personal"; # select a profile defined from my profiles directory
locale = "en_US.UTF-8"; # select locale timezone = "America/Chicago"; # select timezone
bootMode = "uefi"; # uefi or bios locale = "en_US.UTF-8"; # select locale
bootMountPath = "/boot"; # mount path for efi boot partition; only used for uefi boot mode bootMode = "uefi"; # uefi or bios
grubDevice = ""; # device identifier for grub; only used for legacy (bios) boot mode bootMountPath =
}; "/boot"; # mount path for efi boot partition; only used for uefi boot mode
grubDevice =
""; # device identifier for grub; only used for legacy (bios) boot mode
};
# ----- USER SETTINGS ----- # # ----- USER SETTINGS ----- #
userSettings = rec { userSettings = rec {
username = "emmet"; # username username = "emmet"; # username
name = "Emmet"; # name/identifier name = "Emmet"; # name/identifier
email = "emmet@librephoenix.com"; # email (used for certain configurations) email =
dotfilesDir = "~/.dotfiles"; # absolute path of the local repo "emmet@librephoenix.com"; # email (used for certain configurations)
theme = "uwunicorn-yt"; # selcted theme from my themes directory (./themes/) dotfilesDir = "~/.dotfiles"; # absolute path of the local repo
wm = "hyprland"; # Selected window manager or desktop environment; must select one in both ./user/wm/ and ./system/wm/ theme =
# window manager type (hyprland or x11) translator "uwunicorn-yt"; # selcted theme from my themes directory (./themes/)
wmType = if (wm == "hyprland") then "wayland" else "x11"; wm =
browser = "qutebrowser"; # Default browser; must select one from ./user/app/browser/ "hyprland"; # Selected window manager or desktop environment; must select one in both ./user/wm/ and ./system/wm/
defaultRoamDir = "Personal.p"; # Default org roam directory relative to ~/Org # window manager type (hyprland or x11) translator
term = "alacritty"; # Default terminal command; wmType = if (wm == "hyprland") then "wayland" else "x11";
font = "Intel One Mono"; # Selected font browser =
fontPkg = pkgs.intel-one-mono; # Font package "qutebrowser"; # Default browser; must select one from ./user/app/browser/
editor = "emacsclient"; # Default editor; defaultRoamDir =
# editor spawning translator "Personal.p"; # Default org roam directory relative to ~/Org
# generates a command that can be used to spawn editor inside a gui term = "alacritty"; # Default terminal command;
# EDITOR and TERM session variables must be set in home.nix or other module font = "Intel One Mono"; # Selected font
# I set the session variable SPAWNEDITOR to this in my home.nix for convenience fontPkg = pkgs.intel-one-mono; # Font package
spawnEditor = if (editor == "emacsclient") then "emacsclient -c -a 'emacs'" editor = "emacsclient"; # Default editor;
else (if ((editor == "vim") || (editor == "nvim") || (editor == "nano")) then "exec " + term + " -e " + editor else editor); # editor spawning translator
}; # generates a command that can be used to spawn editor inside a gui
# EDITOR and TERM session variables must be set in home.nix or other module
# I set the session variable SPAWNEDITOR to this in my home.nix for convenience
spawnEditor = if (editor == "emacsclient") then
"emacsclient -c -a 'emacs'"
else
(if ((editor == "vim") || (editor == "nvim")
|| (editor == "nano")) then
"exec " + term + " -e " + editor
else
editor);
};
# create patched nixpkgs
nixpkgs-patched =
(import nixpkgs { system = systemSettings.system; }).applyPatches {
name = "nixpkgs-patched";
src = nixpkgs;
patches = [ ./patches/emacs-no-version-check.patch ];
};
# create patched nixpkgs # configure pkgs
nixpkgs-patched = (import nixpkgs { system = systemSettings.system; }).applyPatches { pkgs = import nixpkgs-patched {
name = "nixpkgs-patched"; system = systemSettings.system;
src = nixpkgs; config = {
patches = [ allowUnfree = true;
./patches/emacs-no-version-check.patch allowUnfreePredicate = (_: true);
]; };
}; overlays = [ rust-overlay.overlays.default ];
};
# configure pkgs pkgs-stable = import nixpkgs-stable {
pkgs = import nixpkgs-patched { system = systemSettings.system;
system = systemSettings.system; config = {
config = { allowUnfree = true; allowUnfree = true;
allowUnfreePredicate = (_: true); }; allowUnfreePredicate = (_: true);
overlays = [ rust-overlay.overlays.default ]; };
}; overlays = [ rust-overlay.overlays.default ];
};
pkgs-stable = import nixpkgs-stable { # configure lib
system = systemSettings.system; lib = nixpkgs.lib;
config = { allowUnfree = true;
allowUnfreePredicate = (_: true); };
overlays = [ rust-overlay.overlays.default ];
};
# configure lib # Systems that can run tests:
lib = nixpkgs.lib; supportedSystems = [ "aarch64-linux" "i686-linux" "x86_64-linux" ];
# Systems that can run tests: # Function to generate a set based on supported systems:
supportedSystems = [ forAllSystems = inputs.nixpkgs.lib.genAttrs supportedSystems;
"aarch64-linux"
"i686-linux"
"x86_64-linux"
];
# Function to generate a set based on supported systems: # Attribute set of nixpkgs for each system:
forAllSystems = inputs.nixpkgs.lib.genAttrs supportedSystems; nixpkgsFor =
forAllSystems (system: import inputs.nixpkgs { inherit system; });
# Attribute set of nixpkgs for each system: in {
nixpkgsFor = forAllSystems (system: homeConfigurations = {
import inputs.nixpkgs { inherit system; }); user = home-manager.lib.homeManagerConfiguration {
in {
homeConfigurations = {
user = home-manager.lib.homeManagerConfiguration {
inherit pkgs; inherit pkgs;
modules = [ (./. + "/profiles"+("/"+systemSettings.profile)+"/home.nix") # load home.nix from selected PROFILE modules = [
# inputs.nix-flatpak.homeManagerModules.nix-flatpak # Declarative flatpaks (./. + "/profiles" + ("/" + systemSettings.profile)
]; + "/home.nix") # load home.nix from selected PROFILE
# inputs.nix-flatpak.homeManagerModules.nix-flatpak # Declarative flatpaks
];
extraSpecialArgs = { extraSpecialArgs = {
# pass config variables from above # pass config variables from above
inherit pkgs-stable; inherit pkgs-stable;
@ -108,40 +122,47 @@
inherit (inputs) stylix; inherit (inputs) stylix;
inherit (inputs) hyprland-plugins; inherit (inputs) hyprland-plugins;
}; };
};
};
nixosConfigurations = {
system = lib.nixosSystem {
system = systemSettings.system;
modules = [ (./. + "/profiles"+("/"+systemSettings.profile)+"/configuration.nix") ]; # load configuration.nix from selected PROFILE
specialArgs = {
# pass config variables from above
inherit pkgs-stable;
inherit systemSettings;
inherit userSettings;
inherit (inputs) stylix;
inherit (inputs) blocklist-hosts;
}; };
}; };
}; nixosConfigurations = {
system = lib.nixosSystem {
packages = forAllSystems (system: system = systemSettings.system;
let pkgs = nixpkgsFor.${system}; in modules = [
{ (./. + "/profiles" + ("/" + systemSettings.profile)
default = self.packages.${system}.install; + "/configuration.nix")
]; # load configuration.nix from selected PROFILE
install = pkgs.writeScriptBin "install" ./install.sh; specialArgs = {
}); # pass config variables from above
inherit pkgs-stable;
apps = forAllSystems (system: { inherit systemSettings;
default = self.apps.${system}.install; inherit userSettings;
inherit (inputs) stylix;
install = { inherit (inputs) blocklist-hosts;
type = "app"; };
program = "${self.packages.${system}.install}/bin/install"; };
}; };
});
}; packages = forAllSystems (system:
let pkgs = nixpkgsFor.${system};
in {
default = self.packages.${system}.install;
install = pkgs.writeShellApplication {
name = "install";
runtimeInputs = with pkgs; [ git ];
text = ''${./install.sh} "$@"'';
};
});
#apps = forAllSystems (system: {
# default = self.apps.${system}.install;
# install = {
# type = "app";
# program = "${self.packages.${system}.install}/bin/install";
# };
#});
};
inputs = { inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable"; nixpkgs.url = "nixpkgs/nixos-unstable";