mirror of
https://github.com/librephoenix/nixos-config
synced 2025-01-19 07:05:51 +05:30
Testing updated autoinstall script
This commit is contained in:
parent
069e6efd08
commit
6f3bb3cca5
107
flake.nix
107
flake.nix
|
@ -1,35 +1,43 @@
|
||||||
{
|
{
|
||||||
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 =
|
||||||
|
"personal"; # select a profile defined from my profiles directory
|
||||||
timezone = "America/Chicago"; # select timezone
|
timezone = "America/Chicago"; # select timezone
|
||||||
locale = "en_US.UTF-8"; # select locale
|
locale = "en_US.UTF-8"; # select locale
|
||||||
bootMode = "uefi"; # uefi or bios
|
bootMode = "uefi"; # uefi or bios
|
||||||
bootMountPath = "/boot"; # mount path for efi boot partition; only used for uefi boot mode
|
bootMountPath =
|
||||||
grubDevice = ""; # device identifier for grub; only used for legacy (bios) boot mode
|
"/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 =
|
||||||
|
"emmet@librephoenix.com"; # email (used for certain configurations)
|
||||||
dotfilesDir = "~/.dotfiles"; # absolute path of the local repo
|
dotfilesDir = "~/.dotfiles"; # absolute path of the local repo
|
||||||
theme = "uwunicorn-yt"; # selcted theme from my themes directory (./themes/)
|
theme =
|
||||||
wm = "hyprland"; # Selected window manager or desktop environment; must select one in both ./user/wm/ and ./system/wm/
|
"uwunicorn-yt"; # selcted theme from my themes directory (./themes/)
|
||||||
|
wm =
|
||||||
|
"hyprland"; # Selected window manager or desktop environment; must select one in both ./user/wm/ and ./system/wm/
|
||||||
# window manager type (hyprland or x11) translator
|
# window manager type (hyprland or x11) translator
|
||||||
wmType = if (wm == "hyprland") then "wayland" else "x11";
|
wmType = if (wm == "hyprland") then "wayland" else "x11";
|
||||||
browser = "qutebrowser"; # Default browser; must select one from ./user/app/browser/
|
browser =
|
||||||
defaultRoamDir = "Personal.p"; # Default org roam directory relative to ~/Org
|
"qutebrowser"; # Default browser; must select one from ./user/app/browser/
|
||||||
|
defaultRoamDir =
|
||||||
|
"Personal.p"; # Default org roam directory relative to ~/Org
|
||||||
term = "alacritty"; # Default terminal command;
|
term = "alacritty"; # Default terminal command;
|
||||||
font = "Intel One Mono"; # Selected font
|
font = "Intel One Mono"; # Selected font
|
||||||
fontPkg = pkgs.intel-one-mono; # Font package
|
fontPkg = pkgs.intel-one-mono; # Font package
|
||||||
|
@ -38,32 +46,40 @@
|
||||||
# generates a command that can be used to spawn editor inside a gui
|
# 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
|
# 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
|
# I set the session variable SPAWNEDITOR to this in my home.nix for convenience
|
||||||
spawnEditor = if (editor == "emacsclient") then "emacsclient -c -a 'emacs'"
|
spawnEditor = if (editor == "emacsclient") then
|
||||||
else (if ((editor == "vim") || (editor == "nvim") || (editor == "nano")) then "exec " + term + " -e " + editor else editor);
|
"emacsclient -c -a 'emacs'"
|
||||||
|
else
|
||||||
|
(if ((editor == "vim") || (editor == "nvim")
|
||||||
|
|| (editor == "nano")) then
|
||||||
|
"exec " + term + " -e " + editor
|
||||||
|
else
|
||||||
|
editor);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
# create patched nixpkgs
|
# create patched nixpkgs
|
||||||
nixpkgs-patched = (import nixpkgs { system = systemSettings.system; }).applyPatches {
|
nixpkgs-patched =
|
||||||
|
(import nixpkgs { system = systemSettings.system; }).applyPatches {
|
||||||
name = "nixpkgs-patched";
|
name = "nixpkgs-patched";
|
||||||
src = nixpkgs;
|
src = nixpkgs;
|
||||||
patches = [
|
patches = [ ./patches/emacs-no-version-check.patch ];
|
||||||
./patches/emacs-no-version-check.patch
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# configure pkgs
|
# configure pkgs
|
||||||
pkgs = import nixpkgs-patched {
|
pkgs = import nixpkgs-patched {
|
||||||
system = systemSettings.system;
|
system = systemSettings.system;
|
||||||
config = { allowUnfree = true;
|
config = {
|
||||||
allowUnfreePredicate = (_: true); };
|
allowUnfree = true;
|
||||||
|
allowUnfreePredicate = (_: true);
|
||||||
|
};
|
||||||
overlays = [ rust-overlay.overlays.default ];
|
overlays = [ rust-overlay.overlays.default ];
|
||||||
};
|
};
|
||||||
|
|
||||||
pkgs-stable = import nixpkgs-stable {
|
pkgs-stable = import nixpkgs-stable {
|
||||||
system = systemSettings.system;
|
system = systemSettings.system;
|
||||||
config = { allowUnfree = true;
|
config = {
|
||||||
allowUnfreePredicate = (_: true); };
|
allowUnfree = true;
|
||||||
|
allowUnfreePredicate = (_: true);
|
||||||
|
};
|
||||||
overlays = [ rust-overlay.overlays.default ];
|
overlays = [ rust-overlay.overlays.default ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -71,24 +87,22 @@
|
||||||
lib = nixpkgs.lib;
|
lib = nixpkgs.lib;
|
||||||
|
|
||||||
# Systems that can run tests:
|
# Systems that can run tests:
|
||||||
supportedSystems = [
|
supportedSystems = [ "aarch64-linux" "i686-linux" "x86_64-linux" ];
|
||||||
"aarch64-linux"
|
|
||||||
"i686-linux"
|
|
||||||
"x86_64-linux"
|
|
||||||
];
|
|
||||||
|
|
||||||
# Function to generate a set based on supported systems:
|
# Function to generate a set based on supported systems:
|
||||||
forAllSystems = inputs.nixpkgs.lib.genAttrs supportedSystems;
|
forAllSystems = inputs.nixpkgs.lib.genAttrs supportedSystems;
|
||||||
|
|
||||||
# Attribute set of nixpkgs for each system:
|
# Attribute set of nixpkgs for each system:
|
||||||
nixpkgsFor = forAllSystems (system:
|
nixpkgsFor =
|
||||||
import inputs.nixpkgs { inherit system; });
|
forAllSystems (system: import inputs.nixpkgs { inherit system; });
|
||||||
|
|
||||||
in {
|
in {
|
||||||
homeConfigurations = {
|
homeConfigurations = {
|
||||||
user = home-manager.lib.homeManagerConfiguration {
|
user = home-manager.lib.homeManagerConfiguration {
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
modules = [ (./. + "/profiles"+("/"+systemSettings.profile)+"/home.nix") # load home.nix from selected PROFILE
|
modules = [
|
||||||
|
(./. + "/profiles" + ("/" + systemSettings.profile)
|
||||||
|
+ "/home.nix") # load home.nix from selected PROFILE
|
||||||
# inputs.nix-flatpak.homeManagerModules.nix-flatpak # Declarative flatpaks
|
# inputs.nix-flatpak.homeManagerModules.nix-flatpak # Declarative flatpaks
|
||||||
];
|
];
|
||||||
extraSpecialArgs = {
|
extraSpecialArgs = {
|
||||||
|
@ -113,7 +127,10 @@
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
system = lib.nixosSystem {
|
system = lib.nixosSystem {
|
||||||
system = systemSettings.system;
|
system = systemSettings.system;
|
||||||
modules = [ (./. + "/profiles"+("/"+systemSettings.profile)+"/configuration.nix") ]; # load configuration.nix from selected PROFILE
|
modules = [
|
||||||
|
(./. + "/profiles" + ("/" + systemSettings.profile)
|
||||||
|
+ "/configuration.nix")
|
||||||
|
]; # load configuration.nix from selected PROFILE
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
# pass config variables from above
|
# pass config variables from above
|
||||||
inherit pkgs-stable;
|
inherit pkgs-stable;
|
||||||
|
@ -126,21 +143,25 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
packages = forAllSystems (system:
|
packages = forAllSystems (system:
|
||||||
let pkgs = nixpkgsFor.${system}; in
|
let pkgs = nixpkgsFor.${system};
|
||||||
{
|
in {
|
||||||
default = self.packages.${system}.install;
|
default = self.packages.${system}.install;
|
||||||
|
|
||||||
install = pkgs.writeScriptBin "install" ./install.sh;
|
install = pkgs.writeShellApplication {
|
||||||
});
|
name = "install";
|
||||||
|
runtimeInputs = with pkgs; [ git ];
|
||||||
apps = forAllSystems (system: {
|
text = ''${./install.sh} "$@"'';
|
||||||
default = self.apps.${system}.install;
|
|
||||||
|
|
||||||
install = {
|
|
||||||
type = "app";
|
|
||||||
program = "${self.packages.${system}.install}/bin/install";
|
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
#apps = forAllSystems (system: {
|
||||||
|
# default = self.apps.${system}.install;
|
||||||
|
|
||||||
|
# install = {
|
||||||
|
# type = "app";
|
||||||
|
# program = "${self.packages.${system}.install}/bin/install";
|
||||||
|
# };
|
||||||
|
#});
|
||||||
};
|
};
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
|
|
Loading…
Reference in a new issue