proper dendritifcation progress
This commit is contained in:
parent
f9303305c9
commit
35979521f9
10 changed files with 243 additions and 205 deletions
23
flake.nix
23
flake.nix
|
|
@ -2,6 +2,18 @@
|
||||||
|
|
||||||
description = "SerenityOS";
|
description = "SerenityOS";
|
||||||
|
|
||||||
|
# my 1 trillionth rewrite of my flake, hopefully more robust and easier to modify in future now
|
||||||
|
# rewriting using the 'dendritic' pattern using flake-parts and such, based on examples provided by:
|
||||||
|
#
|
||||||
|
# vimjoyer
|
||||||
|
# https://www.vimjoyer.com/nix/dendritic-home-manager
|
||||||
|
#
|
||||||
|
# v3rm1n
|
||||||
|
# https://codeberg.org/v3rm1n/dotfiles
|
||||||
|
#
|
||||||
|
# quantenzitrone
|
||||||
|
# https://codeberg.org/quantenzitrone/nixos-config
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
|
|
||||||
# nix hardware - https://github.com/NixOS/nixos-hardware
|
# nix hardware - https://github.com/NixOS/nixos-hardware
|
||||||
|
|
@ -14,10 +26,7 @@
|
||||||
url = "github:nixos/nixpkgs/nixos-unstable";
|
url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
};
|
};
|
||||||
|
|
||||||
# dendritic stuff - https://www.vimjoyer.com/vid79-parts-wrapped
|
# dendritic stuff - https://github.com/mightyiam/dendritic
|
||||||
den = {
|
|
||||||
url = "github:vic/den/v0.17.0";
|
|
||||||
};
|
|
||||||
flake-parts = {
|
flake-parts = {
|
||||||
url = "github:hercules-ci/flake-parts";
|
url = "github:hercules-ci/flake-parts";
|
||||||
};
|
};
|
||||||
|
|
@ -27,9 +36,6 @@
|
||||||
import-tree = {
|
import-tree = {
|
||||||
url = "github:vic/import-tree";
|
url = "github:vic/import-tree";
|
||||||
};
|
};
|
||||||
wrapper-modules = {
|
|
||||||
url = "github:BirdeeHub/nix-wrapper-modules";
|
|
||||||
};
|
|
||||||
|
|
||||||
# sound driver optimisations - https://github.com/musnix/musnix
|
# sound driver optimisations - https://github.com/musnix/musnix
|
||||||
musnix = {
|
musnix = {
|
||||||
|
|
@ -41,9 +47,6 @@
|
||||||
url = "github:fufexan/nix-gaming";
|
url = "github:fufexan/nix-gaming";
|
||||||
};
|
};
|
||||||
|
|
||||||
# secrets management - https://github.com/Mic92/sops-nix
|
|
||||||
#sops-nix = { url = "github:Mic92/sops-nix"; };
|
|
||||||
|
|
||||||
# declarative dots - https://github.com/nix-community/home-manager
|
# declarative dots - https://github.com/nix-community/home-manager
|
||||||
home-manager = {
|
home-manager = {
|
||||||
url = "github:nix-community/home-manager";
|
url = "github:nix-community/home-manager";
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,17 @@
|
||||||
{ self, inputs, ... }: {
|
{ self, ... }: {
|
||||||
|
|
||||||
flake.nixosModules.desktop = { pkgs, ... }: {
|
flake.nixosModules.desktop = {
|
||||||
|
|
||||||
|
# modules to include
|
||||||
|
imports = with self.nixosModules; [
|
||||||
|
#greeter
|
||||||
|
niri
|
||||||
|
noctalia
|
||||||
|
#stylix
|
||||||
|
];
|
||||||
|
|
||||||
#programs.foo = bar;
|
#programs.foo = bar;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
flake.homeModules.desktop = { self, inputs, ... }: {
|
|
||||||
|
|
||||||
imports = with self.homeModules; [
|
|
||||||
niri
|
|
||||||
terminal
|
|
||||||
];
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,44 +1,50 @@
|
||||||
{ self, inputs, ... }: {
|
{ self, inputs, ... }: {
|
||||||
|
|
||||||
# module declaration
|
# module declaration
|
||||||
flake.nixosModules.niri = { pkgs, ... }: {
|
flake.nixosModules.niri = { config, lib, pkgs, ... }:
|
||||||
|
|
||||||
programs.niri = {
|
let
|
||||||
|
|
||||||
# enables niri
|
username = config.userOptions.username;
|
||||||
enable = true;
|
|
||||||
|
|
||||||
};
|
in
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
# defines a niri hm config
|
|
||||||
flake.homeModules.niri =
|
|
||||||
{
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
imports = with self.homeModules; [
|
imports = [
|
||||||
# launcher
|
|
||||||
wofi
|
# for home manager functionality
|
||||||
# desktop shell
|
inputs.home-manager.nixosModules.home-manager
|
||||||
noctalia
|
|
||||||
|
# for noctalia shell atop niri
|
||||||
|
self.nixosModules.noctalia
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
programs = {
|
environment = {
|
||||||
|
|
||||||
niri = {
|
# packages for desktop environment
|
||||||
|
systemPackages = with pkgs; [
|
||||||
|
foo
|
||||||
|
bar
|
||||||
|
];
|
||||||
|
|
||||||
# enables niri
|
};
|
||||||
|
|
||||||
|
# session management
|
||||||
|
programs.uwsm = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# enables niri globally
|
||||||
|
programs.niri = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
# niri settings
|
# niri settings
|
||||||
|
home-manager.users.${username} = {
|
||||||
|
programs.niri = {
|
||||||
|
|
||||||
settings = {
|
settings = {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
@ -47,6 +53,4 @@
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,45 @@
|
||||||
{ self, inputs, ... }: {
|
{ inputs, ... }: {
|
||||||
|
|
||||||
perSystem = { pkgs, ... }: {
|
flake.nixosModules.noctalia =
|
||||||
|
{ config, lib, ... }:
|
||||||
|
|
||||||
# defines a custom noctalia package
|
let
|
||||||
packages.myNoctalia = inputs.wrapper-modules.wrappers.noctalia-shell.wrap {
|
username = config.userOptions.username;
|
||||||
|
hostName = config.userOptions.hostName;
|
||||||
|
wallpaper = config.userOptions.wallpaper;
|
||||||
|
in
|
||||||
|
|
||||||
# use global packages
|
{
|
||||||
inherit pkgs;
|
|
||||||
|
|
||||||
# use a separate json file to configure
|
# for home manager functionality
|
||||||
# nixify this.
|
imports = [ inputs.home-manager.nixosModules.home-manager ];
|
||||||
settings = (builtins.fromJSON (builtins.readFile ./noctalia.json)).settings;
|
home-manager.users.${username} = {
|
||||||
|
imports = [ inputs.noctalia.homeModules.default ];
|
||||||
|
|
||||||
|
programs.noctalia-shell = {
|
||||||
|
|
||||||
|
# enables noctalia
|
||||||
|
enable = true;
|
||||||
|
systemd.enable = true;
|
||||||
|
|
||||||
|
# noctalia settings
|
||||||
|
settings = {
|
||||||
|
|
||||||
|
general = { };
|
||||||
|
|
||||||
|
location = { };
|
||||||
|
|
||||||
|
colorSchemes.predefinedscheme = "foobar";
|
||||||
|
|
||||||
|
dock = {
|
||||||
|
enabled = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
bar = { };
|
||||||
|
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,66 +1,22 @@
|
||||||
{
|
{ self, inputs, ... }:
|
||||||
self,
|
|
||||||
inputs,
|
|
||||||
config,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
|
||||||
|
|
||||||
# default username here
|
|
||||||
username = "serenity";
|
|
||||||
|
|
||||||
in
|
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
# defines the hades specific configuration (glue code?)
|
# defines the hades specific configuration
|
||||||
flake.nixosConfigurations.hades = inputs.nixpkgs.lib.nixosSystem {
|
flake.nixosConfigurations.hades = inputs.nixpkgs.lib.nixosSystem {
|
||||||
|
|
||||||
# modules that comprise the host specific configuration
|
# modules that comprise the host specific configuration
|
||||||
modules = with self.nixosModules; [
|
modules = with self.nixosModules; [
|
||||||
|
|
||||||
# actual desktop module set defined below
|
# host-specific hardware options
|
||||||
hades
|
hadesHardware
|
||||||
|
|
||||||
];
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
# module set that comprises the hades configuration
|
|
||||||
flake.nixosModules.hades =
|
|
||||||
{
|
|
||||||
pkgs,
|
|
||||||
inputs,
|
|
||||||
config,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
|
||||||
|
|
||||||
imports = with self.nixosModules; [
|
|
||||||
|
|
||||||
# core system modules
|
|
||||||
core
|
|
||||||
|
|
||||||
# hades system modules
|
|
||||||
hades-hardware
|
|
||||||
|
|
||||||
# extra modules
|
|
||||||
gaming
|
|
||||||
|
|
||||||
# users to include on host
|
# users to include on host
|
||||||
serenity
|
serenity
|
||||||
|
|
||||||
# home manager and home manager imports
|
# extra modules to include on host
|
||||||
inputs.home-manager.nixosModules.home-manager
|
|
||||||
{
|
|
||||||
home-manager.users.serenity = {
|
|
||||||
imports = with self.homeModules; [
|
|
||||||
desktop
|
desktop
|
||||||
];
|
terminal
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,34 +0,0 @@
|
||||||
{ self, inputs, ... }: {
|
|
||||||
|
|
||||||
flake.homeModules.core-home = { config, pkgs, ... }: {
|
|
||||||
|
|
||||||
#modules = [
|
|
||||||
#self.modules.terminal
|
|
||||||
#self.modules.theme
|
|
||||||
#];
|
|
||||||
|
|
||||||
imports = [
|
|
||||||
#./terminal
|
|
||||||
self.modules.terminal
|
|
||||||
self.modules.desktop
|
|
||||||
#self.modules.theme
|
|
||||||
];
|
|
||||||
|
|
||||||
home = {
|
|
||||||
username = "serenity";
|
|
||||||
homeDirectory = "/home/serenity";
|
|
||||||
stateVersion = "26.05";
|
|
||||||
#extraOutputsToInstall = [ ];
|
|
||||||
};
|
|
||||||
|
|
||||||
# disable manuals as nmd fails to build often
|
|
||||||
manual = {
|
|
||||||
html.enable = false;
|
|
||||||
json.enable = false;
|
|
||||||
manpages.enable = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
# let HM manage itself when in standalone mode
|
|
||||||
programs.home-manager.enable = true;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -1,20 +1,41 @@
|
||||||
{ self, lib, ... }:
|
{ self, inputs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
flake.nixosModules.core = { pkgs, ... }: {
|
flake.nixosModules.core = { config, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
|
||||||
|
# flakepath for QoL
|
||||||
|
flakePath = config.userOptions.flakePath
|
||||||
|
|
||||||
|
# username
|
||||||
|
username = config.userOptions.username
|
||||||
|
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
# other modules to load
|
# other modules to load
|
||||||
imports = with self.nixosModules; [
|
imports = [
|
||||||
core-packages
|
|
||||||
|
# core packages to load
|
||||||
|
self.nixosModules.core-packages
|
||||||
|
|
||||||
|
# home manager functionality
|
||||||
|
inputs.home-manager.nixosModules.home-manager
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
# extra features
|
# extra features
|
||||||
nix.settings.experimental-features = [
|
nix.settings.experimental-features = [
|
||||||
|
|
||||||
# flake based config requires flakes
|
# flake based config requires flakes
|
||||||
"flakes"
|
"flakes"
|
||||||
|
|
||||||
#fancier nix usage
|
#fancier nix usage
|
||||||
"nix-command"
|
"nix-command"
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
# compresses half the ram for use as swap
|
# compresses half the ram for use as swap
|
||||||
|
|
@ -32,6 +53,19 @@
|
||||||
# meanjin time
|
# meanjin time
|
||||||
time.timeZone = lib.mkDefault "Austrlia/Brisbane";
|
time.timeZone = lib.mkDefault "Austrlia/Brisbane";
|
||||||
|
|
||||||
|
# home manager settings
|
||||||
|
home-manager = {
|
||||||
|
verbose = true;
|
||||||
|
overwriteBackup = true;
|
||||||
|
backupFileExtension = ".bak";
|
||||||
|
useGlobalPkgs = true;
|
||||||
|
useUserPackages = true;
|
||||||
|
users.${username} = {
|
||||||
|
home.stateversion = "24.11";
|
||||||
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
# don't touch this
|
# don't touch this
|
||||||
system.stateVersion = lib.mkDefault "24.11";
|
system.stateVersion = lib.mkDefault "24.11";
|
||||||
documentation.dev.enable = true;
|
documentation.dev.enable = true;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,11 @@
|
||||||
{
|
{ inputs, ... }: {
|
||||||
|
|
||||||
|
imports = [
|
||||||
|
|
||||||
|
# necessary for home manager functionality
|
||||||
|
inputs.home-manager.flakeModules.home-manager
|
||||||
|
|
||||||
|
];
|
||||||
|
|
||||||
# misc flake-parts configuration
|
# misc flake-parts configuration
|
||||||
config = {
|
config = {
|
||||||
|
|
|
||||||
78
modules/users/options.nix
Normal file
78
modules/users/options.nix
Normal file
|
|
@ -0,0 +1,78 @@
|
||||||
|
# User Options Module
|
||||||
|
#
|
||||||
|
# This module defines the core user-level configuration options that are used
|
||||||
|
# throughout the system. These options provide a centralized way to configure
|
||||||
|
# user-specific settings without modifying individual modules.
|
||||||
|
#
|
||||||
|
# Usage:
|
||||||
|
# Set these options in your host configuration (e.g., hosts/Desktop/modules/userOptions.nix):
|
||||||
|
#
|
||||||
|
# config.userOptions = {
|
||||||
|
# username = "myuser";
|
||||||
|
# hostName = "myhost";
|
||||||
|
# colorScheme = "kanagawa";
|
||||||
|
# wallpaper = "kanagawa.png";
|
||||||
|
# dots = "/home/myuser/.dotfiles";
|
||||||
|
# };
|
||||||
|
#
|
||||||
|
# These options are then accessible throughout all modules via `config.userOptions.*`
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
|
||||||
|
flake.nixosModules.modulesUser =
|
||||||
|
{ lib, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
options.userOptions = {
|
||||||
|
|
||||||
|
colorScheme = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
description = ''
|
||||||
|
The base16 color scheme name for Stylix theming.
|
||||||
|
This will be used to theme all compatible applications system-wide.
|
||||||
|
|
||||||
|
Available schemes: https://github.com/tinted-theming/schemes
|
||||||
|
Popular options: "kanagawa", "catppuccin-macchiato", "tokyo-night", "gruvbox-dark-medium", "nord"
|
||||||
|
'';
|
||||||
|
example = "kanagawa";
|
||||||
|
};
|
||||||
|
|
||||||
|
dots = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
description = ''
|
||||||
|
The absolute path to the dotfiles repository (flake root).
|
||||||
|
Used by various modules to reference assets and configuration files.
|
||||||
|
'';
|
||||||
|
example = "/home/user/.dotfiles";
|
||||||
|
};
|
||||||
|
|
||||||
|
hostName = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
description = ''
|
||||||
|
The hostname for this system.
|
||||||
|
This will be set as the system hostname and can be used for host-specific configuration.
|
||||||
|
'';
|
||||||
|
example = "Desktop";
|
||||||
|
};
|
||||||
|
|
||||||
|
username = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
description = ''
|
||||||
|
The primary user's username for this system.
|
||||||
|
This is used throughout the configuration for Home Manager and user-specific settings.
|
||||||
|
'';
|
||||||
|
example = "myuser";
|
||||||
|
};
|
||||||
|
|
||||||
|
wallpaper = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
description = ''
|
||||||
|
The wallpaper filename (without path).
|
||||||
|
The file should be located in the assets/ directory of this repository.
|
||||||
|
Stylix will use this wallpaper and can optionally generate colors from it.
|
||||||
|
'';
|
||||||
|
example = "kanagawa.png";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -1,60 +1,25 @@
|
||||||
{ self, inputs, ... }:
|
{ inputs, ... }:
|
||||||
|
|
||||||
# let bindings
|
|
||||||
let
|
|
||||||
|
|
||||||
# set your username here
|
|
||||||
username = "serenity";
|
|
||||||
|
|
||||||
# qol variable to make paths shorter
|
|
||||||
home = "/home/${username}";
|
|
||||||
|
|
||||||
in
|
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
# user module declaration
|
# user module declaration
|
||||||
flake.nixosModules.serenity =
|
flake.nixosModules.serenity =
|
||||||
|
|
||||||
{ pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
|
||||||
|
username = config.userOptions.username;
|
||||||
|
|
||||||
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
# modules to include
|
# necessary for home manager function
|
||||||
modules = [
|
imports = [ inputs.home-manager.nixosModules.home-manager ];
|
||||||
|
|
||||||
# home-manager module
|
|
||||||
inputs.home-manager.nixosModules.home-manager
|
|
||||||
{
|
|
||||||
home-manager = {
|
|
||||||
|
|
||||||
# home-manager settings
|
|
||||||
backupFileExtension = ".bak";
|
|
||||||
overwriteBackup = true;
|
|
||||||
verbose = true;
|
|
||||||
|
|
||||||
# set home-manager packages to follow system
|
|
||||||
useUserPackages = true;
|
|
||||||
useGlobalPkgs = true;
|
|
||||||
|
|
||||||
# hm user declaration
|
|
||||||
users.serenity = {
|
|
||||||
|
|
||||||
# user specific modules to import
|
|
||||||
imports = [
|
|
||||||
self.flake.homeModules.core-home
|
|
||||||
#self.flake.homeModules.${name}
|
|
||||||
];
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
];
|
|
||||||
|
|
||||||
# user declaration
|
# user declaration
|
||||||
users.users.serenity = {
|
users.users.${username} = {
|
||||||
|
|
||||||
# remember to change this
|
# remember to change this
|
||||||
initialPassword = "password";
|
initialPassword = "password";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue