starting to simplify
This commit is contained in:
parent
d946126e63
commit
85c474701d
@ -1,31 +0,0 @@
|
||||
Yes, that's a good approach! You can test the build without actually applying it in a few ways:
|
||||
|
||||
1. Build without applying using `nixos-rebuild`:
|
||||
|
||||
```bash
|
||||
# Build only, don't switch
|
||||
nixos-rebuild build --flake .#steamdeck
|
||||
|
||||
# Build for a remote system
|
||||
nixos-rebuild build --flake .#steamdeck --target-host root@remote-ip
|
||||
```
|
||||
|
||||
2. Check evaluation:
|
||||
```bash
|
||||
# Check if the configuration evaluates without building
|
||||
nix flake check
|
||||
|
||||
# More detailed evaluation
|
||||
nix eval .#nixosConfigurations.steamdeck.config.system.build.toplevel
|
||||
```
|
||||
|
||||
Since there's no sensitive data yet, it's a good time to test the basic structure. Secret management can be added later when needed.
|
||||
|
||||
Would you like help setting up the remote build testing? We would need to:
|
||||
1. Ensure SSH access to the remote machine
|
||||
2. Configure the remote builder
|
||||
3. Set up necessary permissions/access
|
||||
|
||||
Also, there's a feature in nixos-rebuild called `--build-host` that could be useful - it lets you build on a more powerful machine while targeting another system.
|
||||
|
||||
Would you like me to provide the specific commands and configurations for any of these testing approaches?
|
@ -9,8 +9,6 @@ in
|
||||
{
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
../../modules/system
|
||||
../../modules/desktop
|
||||
(jovianNixos + "/modules")
|
||||
];
|
||||
|
||||
|
@ -1,56 +1,42 @@
|
||||
{ lib, ... }: let
|
||||
internals = {
|
||||
# Helper for creating modules
|
||||
mkModuleWithOptions = {
|
||||
config,
|
||||
name,
|
||||
moduleConfig,
|
||||
default ? false,
|
||||
extraOptions ? {},
|
||||
extraCondition ? true,
|
||||
}: { config, lib, pkgs, ... }: let
|
||||
namePathList = lib.splitString "." name;
|
||||
modulePath = ["modules"] ++ namePathList;
|
||||
enableOptionPath = modulePath ++ ["enable"];
|
||||
{ lib, ... }:
|
||||
let
|
||||
# Helper for creating home-manager modules
|
||||
mkHmModule = name: module: { config, lib, pkgs, ... }: {
|
||||
config = lib.mkIf (config.modules.${name}.enable or false)
|
||||
(if builtins.isFunction module
|
||||
then module { inherit config lib pkgs; }
|
||||
else {
|
||||
home-manager.users.${config.user.name} = module;
|
||||
});
|
||||
};
|
||||
|
||||
moduleOptions = {
|
||||
enable = lib.mkOption {
|
||||
inherit default;
|
||||
type = lib.types.bool;
|
||||
description = "Enable [${name}] module";
|
||||
};
|
||||
} // extraOptions;
|
||||
|
||||
# Get the module configuration path
|
||||
cfg = lib.getAttrFromPath modulePath config;
|
||||
in {
|
||||
options = lib.setAttrByPath modulePath moduleOptions;
|
||||
config = lib.mkIf
|
||||
(lib.getAttrFromPath enableOptionPath config && extraCondition)
|
||||
(if builtins.isFunction moduleConfig
|
||||
then moduleConfig { inherit config lib pkgs cfg; }
|
||||
else moduleConfig);
|
||||
};
|
||||
};
|
||||
# Helper for creating desktop/user modules
|
||||
mkUserModule = category: name: module:
|
||||
mkHmModule "${category}.${name}" module;
|
||||
|
||||
exports = {
|
||||
# Function for creating modules.NAME modules, with extra options
|
||||
mkModule' = config: name: extraOptions: moduleConfig:
|
||||
internals.mkModuleWithOptions {inherit config name extraOptions moduleConfig;};
|
||||
# Main module creation helper
|
||||
mkModule = category: name: module:
|
||||
mkUserModule category name (
|
||||
if builtins.isAttrs module
|
||||
then { home.packages = module.packages or [ ]; }
|
||||
else module
|
||||
);
|
||||
|
||||
# Function for creating modules.NAME modules, without extra options
|
||||
mkModule = config: name: moduleConfig:
|
||||
exports.mkModule' config name {} moduleConfig;
|
||||
# Helpers for enabling/disabling modules
|
||||
enable = elems: builtins.listToAttrs (map
|
||||
(name: {
|
||||
inherit name;
|
||||
value.enable = true;
|
||||
})
|
||||
elems);
|
||||
|
||||
# Function for creating modules.NAME modules that are enabled by default, with extra options
|
||||
mkEnabledModule' = config: name: extraOptions: moduleConfig:
|
||||
internals.mkModuleWithOptions {
|
||||
inherit config name extraOptions moduleConfig;
|
||||
default = true;
|
||||
disable = elems: builtins.listToAttrs (map
|
||||
(name: {
|
||||
inherit name;
|
||||
value.enable = false;
|
||||
})
|
||||
elems);
|
||||
};
|
||||
|
||||
# Function for creating modules.NAME modules that are enabled by default, without extra options
|
||||
mkEnabledModule = config: name: moduleConfig:
|
||||
exports.mkEnabledModule' config name {} moduleConfig;
|
||||
};
|
||||
in exports
|
||||
in
|
||||
exports
|
||||
|
@ -1,20 +1,21 @@
|
||||
# modules/desktop/browsers/default.nix
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
options.modules.desktop.browsers = {
|
||||
home-manager.users.${config.user.name} = { # Use home-manager.users path
|
||||
|
||||
enable = lib.mkEnableOption "browser support";
|
||||
|
||||
floorp.enable = lib.mkEnableOption "Floorp browser";
|
||||
chromium.enable = lib.mkEnableOption "Chromium browser";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.modules.desktop.browsers.enable {
|
||||
home.packages = with pkgs; [
|
||||
let
|
||||
inherit (lib.utilMods) mkModule;
|
||||
in
|
||||
mkModule "desktop" "browsers" {
|
||||
packages = with pkgs; [
|
||||
(lib.mkIf config.modules.desktop.browsers.floorp.enable floorp)
|
||||
(lib.mkIf config.modules.desktop.browsers.chromium.enable ungoogled-chromium)
|
||||
];
|
||||
};
|
||||
|
||||
# modules/desktop/productivity/obsidian.nix
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib.utilMods) mkModule;
|
||||
in mkModule "desktop" "productivity.obsidian" {
|
||||
packages = [ pkgs.obsidian ];
|
||||
};
|
||||
}
|
@ -1,19 +1,27 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib.utilMods) mkModule;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
./browsers
|
||||
./communication
|
||||
./development
|
||||
# ./gaming
|
||||
./gaming
|
||||
./multiplexers
|
||||
./productivity
|
||||
./terminals
|
||||
./plasma6
|
||||
# ./appimage.nix
|
||||
./appimage.nix
|
||||
];
|
||||
|
||||
options.modules.desktop = {
|
||||
enable = lib.mkEnableOption "desktop environment";
|
||||
};
|
||||
|
||||
# All desktop modules will automatically be wrapped in home-manager configuration
|
||||
config = lib.mkIf config.modules.desktop.enable {
|
||||
home-manager.enable = true;
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user