start to remove modules in favour of options

This commit is contained in:
greyweather committed 2026-08-27 03:08:09 +01:00
1 parent 7245e872f6
commit f770b83b5c
23 files changed
+167 -254

No files matched your search

-148
View File
@@ -1,148 +0,0 @@
{ inputs, self, ... }: {
flake.nixosModules.global = { pkgs, config, lib, ... }: {
options = {
info.rootPath = lib.mkOption {
type = lib.types.str;
default = "/home/grey/nixos";
};
};
config = {
nix.settings.experimental-features = [
"nix-command"
"flakes"
];
nix.gc = {
automatic = true;
persistent = true;
dates = "Sun 05:00";
};
boot.loader.efi.canTouchEfiVariables = true;
networking.networkmanager.enable = true;
time.timeZone = "Europe/London";
i18n.defaultLocale = "en_GB.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "en_GB.UTF-8";
LC_IDENTIFICATION = "en_GB.UTF-8";
LC_MEASUREMENT = "en_GB.UTF-8";
LC_MONETARY = "en_GB.UTF-8";
LC_NAME = "en_GB.UTF-8";
LC_NUMERIC = "en_GB.UTF-8";
LC_PAPER = "en_GB.UTF-8";
LC_TELEPHONE = "en_GB.UTF-8";
LC_TIME = "en_GB.UTF-8";
};
services.xserver.xkb = {
layout = "gb";
variant = "";
};
console.keyMap = "uk";
users.users."grey" = {
isNormalUser = true;
description = "grey";
extraGroups = [ "networkmanager" "wheel" ];
};
nixpkgs.config.allowUnfree = true;
environment.systemPackages = with pkgs; [
git
fzf
jq
busybox
ethtool
wayland-utils
mesa-demos
vulkan-tools
hyperfine
];
fonts.packages = with pkgs; [
iosevka-comfy.comfy
nerd-fonts.jetbrains-mono
];
programs.nano = {
enable = true;
nanorc = ''
set nowrap
set tabstospaces
set tabsize 2
'';
};
hardware.bluetooth = {
enable = true;
powerOnBoot = false;
};
programs.gnupg.agent = {
enable = true;
};
};
};
flake.homeModules.global = { config, pkgs, ... }: {
nix.gc = {
automatic = true;
persistent = true;
dates = "Sun 05:00";
};
home.packages = with pkgs; [
bibata-cursors
x264
speedtest-go
gparted
vlc
];
programs.git = {
enable = true;
lfs.enable = true;
settings = {
user.name = "Grey Jones";
user.email = "grey@greyweather.dev";
};
signing = {
format = "openpgp";
key = "CC7388DF8E1890729921BCFF7C67C51C2FF524D9";
signByDefault = true;
};
};
programs.gpg = {
enable = true;
};
programs.ssh = {
enable = true;
enableDefaultConfig = false;
settings = {
"git.greyweather.dev" = {
HostName = "git.greyweather.dev";
Port = "222";
User = "git";
IdentityFile = "~/.ssh/id_gitea";
};
"github.com" = {
HostName = "github.com";
Port = 22;
User = "git";
IdentityFile = "~/.ssh/id_github";
};
};
};
home.shell.enableBashIntegration = true;
};
}
+23
View File
@@ -0,0 +1,23 @@
{ inputs, self, ... }: {
flake.nixosModules.graphics = { config, pkgs, ... }: {
environment.systemPackages = with pkgs; [
wayland-utils
mesa-demos
vulkan-tools
];
fonts.packages = with pkgs; [
iosevka-comfy.comfy
nerd-fonts.jetbrains-mono
];
};
flake.homeModules.graphics = { config, pkgs, ... }: {
home.packages = with pkgs; [
bibata-cursors
x264
gparted
vlc
];
};
}
@@ -0,0 +1,12 @@
{ inputs, self, ... }: {
flake.nixosModules.global = { lib, config, ... }: {
options.features.applications.cli.fastfetch.enable = lib.mkEnableOption "fastfetch";
};
flake.homeModules.global = { pkgs, lib, osConfig, ... }: {
config = lib.mkIf (osConfig.features.applications.cli.fastfetch.enable) ({
programs.zsh.initContent = lib.mkOrder 1500 "fastfetch";
programs.fastfetch.enable = true;
});
};
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,25 +1,25 @@
{ inputs, self, ... }: {
flake.homeModules.spotify = { pkgs, config, lib, ... }: {
flake.nixosModules.graphics = { lib, ... }: {
options.features.applications.gui.spotify = {
enable = lib.mkEnableOption "spotify";
spicetify.enable = lib.mkEnableOption "spicetify";
};
};
flake.homeModules.graphics = { pkgs, config, lib, osConfig, ... }: {
imports = [
inputs.spicetify.homeManagerModules.default
];
options = {
features.spicetify.enable = lib.mkOption {
type = lib.types.bool;
default = false;
};
};
config = {
home.packages = with pkgs; lib.mkIf (config.features.spicetify.enable == false) [
spotfify
];
home.packages = lib.mkIf (with osConfig.features.applications.gui.spotify; enable && !spicetify.enable) (with pkgs; [
spotify
]);
programs.spicetify =
let
spicePkgs = inputs.spicetify.legacyPackages.${pkgs.stdenv.hostPlatform.system};
in lib.mkIf (config.features.spicetify.enable) {
in lib.mkIf (with osConfig.features.applications.gui.spotify; enable && spicetify.enable) {
enable = true;
enabledExtensions = with spicePkgs.extensions; [
hidePodcasts
File renamed without changes.
-12
View File
@@ -1,12 +0,0 @@
{ inputs, self, ... }: {
flake.nixosModules.home-manager = { pkgs, ... }: {
imports = [
inputs.home-manager.nixosModules.default
];
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
};
};
}
-11
View File
@@ -1,11 +0,0 @@
{ inputs, self, ... }: {
flake.nixosModules.global = { pkgs, config, ... }: {
environment.systemPackages = [
inputs.nh.packages.${pkgs.stdenv.hostPlatform.system}.default
];
programs.nh = {
enable = true;
flake = "/home/grey/nixos";
};
};
}
+15
View File
@@ -0,0 +1,15 @@
{ inputs, self, ... }: {
flake.nixosModules.global = { pkgs, lib, config, ... }: {
imports = [
inputs.home-manager.nixosModules.default
];
options.features.nixos.home-manager.enable = lib.mkEnableOption "home-manager";
config.home-manager = lib.mkIf (config.features.nixos.home-manager.enable) {
useGlobalPkgs = true;
useUserPackages = true;
users.grey = self.homeModules.${config.networking.hostName};
};
};
}
+19
View File
@@ -0,0 +1,19 @@
{ inputs, self, ... }: {
flake.nixosModules.global = { pkgs, config, lib, ... }: {
options.features.nixos.nh.enable = lib.mkOption {
type = lib.types.bool;
default = true;
};
config = lib.mkIf (config.features.nixos.nh.enable) {
environment.systemPackages = [
inputs.nh.packages.${pkgs.stdenv.hostPlatform.system}.default
];
programs.nh = {
enable = true;
flake = "/home/grey/nixos";
};
};
};
}
+15
View File
@@ -0,0 +1,15 @@
{ inputs, self, ... }: {
flake.nixosModules.graphics = { pkgs, lib, config, ... }: {
imports = [
inputs.stylix.nixosModules.stylix
];
options.features.nixos.stylix.enable = lib.mkEnableOption "stylix";
config = lib.mkIf (config.features.nixos.stylix.enable) {
stylix.enable = true;
stylix.image = builtins.path { path = "${self.outPath}/modules/hosts/${config.networking.hostName}/wallpaper.jpg"; };
stylix.polarity = "dark";
};
};
}
+38
View File
@@ -0,0 +1,38 @@
{ inputs, self, ... }: {
flake.nixosModules.global = { config, pkgs, lib, ... }: {
options.features.shells.zsh = {
enable = lib.mkEnableOption "zsh";
antidote.enable = lib.mkEnableOption "antidote";
};
config = lib.mkIf (config.features.shells.zsh.enable) {
programs.zsh.enable = true;
users.defaultUserShell = pkgs.zsh;
users.users."grey".shell = pkgs.zsh;
};
};
flake.homeModules.global = { pkgs, osConfig, lib, ... }: {
config = lib.mkIf (osConfig.features.shells.zsh.enable) {
home.shell.enableZshIntegration = true;
programs.kitty.shellIntegration.enableZshIntegration = true;
programs.zsh = {
enable = true;
completionInit = "";
antidote = lib.mkIf (osConfig.features.shells.zsh.antidote.enable) {
enable = true;
plugins = [
"getantidote/use-omz"
"ohmyzsh/ohmyzsh path:lib"
"ohmyzsh/ohmyzsh path:plugins/command-not-found"
"ohmyzsh/ohmyzsh path:themes/nanotech.zsh-theme"
"zsh-users/zsh-autosuggestions"
"zdharma-continuum/fast-syntax-highlighting"
];
};
};
};
};
}
-7
View File
@@ -1,7 +0,0 @@
{ inputs, self, ... }: {
flake.nixosModules.stylix = { pkgs, ... }: {
imports = [
inputs.stylix.nixosModules.stylix
];
};
}
-12
View File
@@ -57,17 +57,9 @@
jq
busybox
ethtool
wayland-utils
mesa-demos
vulkan-tools
hyperfine
];
fonts.packages = with pkgs; [
iosevka-comfy.comfy
nerd-fonts.jetbrains-mono
];
programs.nano = {
enable = true;
nanorc = ''
@@ -96,11 +88,7 @@
};
home.packages = with pkgs; [
bibata-cursors
x264
speedtest-go
gparted
vlc
];
programs.git = {
-3
View File
@@ -1,3 +0,0 @@
{ inputs, self, ... }: {
# flake.nixosModules.graphics =
}
+3 -4
View File
@@ -1,9 +1,7 @@
{ inputs, self, ... }: {
flake.homeModules.kitagawa = { pkgs, lib, ... }: {
programs.zsh.initContent = lib.mkOrder 1500 "fastfetch";
flake.homeModules.kitagawa = { pkgs, lib, osConfig, ... }: {
config = lib.mkIf (osConfig.features.applications.cli.fastfetch.enable) ({
programs.fastfetch = {
enable = true;
settings = {
logo = {
type = "builtin";
@@ -141,5 +139,6 @@
];
};
};
});
};
}
+30 -16
View File
@@ -1,7 +1,9 @@
{ inputs, self, ... }: {
flake.nixosConfigurations.kitagawa = inputs.nixpkgs.lib.nixosSystem {
modules = [
self.nixosModules.kitagawa
modules = with self.nixosModules; [
global
graphics
kitagawa
];
};
@@ -11,15 +13,36 @@
networking.hostName = "kitagawa";
imports = with self.nixosModules; [
global
home-manager
stylix
ly
niri
noctalia
zsh
];
features = {
nixos = {
home-manager.enable = true;
stylix.enable = true;
};
shells.zsh = {
enable = true;
antidote.enable = true;
};
applications = {
cli = {
fastfetch.enable = true;
};
gui = {
spotify = {
enable = true;
spicetify.enable = true;
};
};
};
};
nix.buildMachines = [
{
hostName = "nixremote";
@@ -63,12 +86,6 @@
maxGenerations = 10;
};
};
stylix.enable = true;
stylix.image = ./wallpaper.jpg;
stylix.polarity = "dark";
home-manager.users.grey = self.homeModules.kitagawa;
};
flake.homeModules.kitagawa = { config, pkgs, inputs, lib, ... }: {
@@ -76,18 +93,15 @@
imports = with self.homeModules; [
global
graphics
niri
noctalia
vscode
kitty
zsh
floorp
equibop
spotify
];
features.spicetify.enable = true;
/*
imports = [
#"${global-configs}/gnome.nix"
File renamed without changes.
-29
View File
@@ -1,29 +0,0 @@
{ inputs, self, ... }: {
flake.nixosModules.zsh = { config, pkgs, ... }: {
programs.zsh.enable = true;
users.defaultUserShell = pkgs.zsh;
users.users."grey".shell = pkgs.zsh;
};
flake.homeModules.zsh = { pkgs, ... }: {
home.shell.enableZshIntegration = true;
programs.kitty.shellIntegration.enableZshIntegration = true;
programs.zsh = {
enable = true;
completionInit = "";
antidote = {
enable = true;
plugins = [
"getantidote/use-omz"
"ohmyzsh/ohmyzsh path:lib"
"ohmyzsh/ohmyzsh path:plugins/command-not-found"
"ohmyzsh/ohmyzsh path:themes/nanotech.zsh-theme"
"zsh-users/zsh-autosuggestions"
"zdharma-continuum/fast-syntax-highlighting"
];
};
};
};
}