Compare commits

..

18 commits

Author SHA1 Message Date
2c0062bf51 flake: home-manager: export NixOS homes
All checks were successful
ci/woodpecker/push/check Pipeline was successful
And here is what the last few commits were building up to.

This is neat, but won't be useful *very* often.
2025-07-07 15:08:04 +00:00
31effae175 flake: home-manager: refactor 'mkHome'
This will allow making a similar function for NixOS homes.
2025-07-07 15:08:04 +00:00
87ba726b18 flake: home-manager: use 'hosts' option 2025-07-07 15:08:04 +00:00
9e35764e0c flake: nixos: use 'hosts' option 2025-07-07 15:08:04 +00:00
1c86c85c56 flake: add hosts
This will allow other modules to cross-reference which hosts exist on
which system.

My main use-case is to automatically declare home-manager configuration
for the home configuration of NixOS hosts.

I also include Darwin in case I ever want to use that in the future,
though that is unlikely for the moment.
2025-07-07 15:08:04 +00:00
7ac78ca260 hosts: nixos: porthos: add profiles 2025-07-07 15:08:04 +00:00
d181f3a719 common: profiles: forward profiles to home-manager
We can only do this now that every profile has been migrated, otherwise
we would get errors about undeclared modules... It's not perfect, but
it's good enough.
2025-07-07 15:08:04 +00:00
2a6696bafc common: profiles: migrate X 2025-07-07 15:08:03 +00:00
75f1776916 common: profiles: migrate wm 2025-07-07 15:08:03 +00:00
b1be9f20d9 common: profiles: migrate laptop 2025-07-07 15:08:03 +00:00
a68c26c6ef common: profiles: migrate gtk 2025-07-07 15:08:03 +00:00
9ee0cb3287 common: profiles: migrate devices 2025-07-07 15:08:03 +00:00
e01c8330d6 common: profiles: migrate bluetooth 2025-07-07 15:08:03 +00:00
033b0e8a57 common: add profiles
I will be migrating each sub-module one by one.
2025-07-07 15:08:03 +00:00
27a486bf5c flake: nixos: import common modules 2025-07-07 15:08:03 +00:00
5d706dd2dc flake: home-manager: import common modules 2025-07-07 15:08:03 +00:00
748e55f1a6 nixos: home: import common modules 2025-07-07 15:08:03 +00:00
2ed60a227e modules: add common
This should define modules that are identical, or very similar.

The driving force is to be able to use `my.profiles` on home-manager and NixOS
without repeating myself.

In the future I might migrate other modules, such as `nixos/system/nix`...
2025-07-07 15:08:02 +00:00
7 changed files with 10 additions and 17 deletions

View file

@ -4,7 +4,7 @@
let
allowedClass = [
"darwin"
"home"
"homeManager"
"nixos"
];
@ -18,16 +18,9 @@ in
config = {
assertions = [
{
assertion = type != null;
assertion = builtins.elem _class allowedClass;
message = ''
You must provide `type` as part of specialArgs to use the common modules.
It must be one of ${allowedClassString}.
'';
}
{
assertion = type != null -> builtins.elem type allowedClass;
message = ''
`type` specialArgs must be one of ${allowedClassString}.
`_class` specialArgs must be one of ${allowedClassString}.
'';
}
];

View file

@ -8,7 +8,7 @@ in
};
config = lib.mkIf cfg.enable (lib.mkMerge [
(lib.optionalAttrs (_class == "home") {
(lib.optionalAttrs (_class == "homeManager") {
my.home.bluetooth.enable = true;
})

View file

@ -1,5 +1,5 @@
# Configuration that spans across system and home, or are almagations of modules
{ config, lib, type, ... }:
{ config, lib, _class, ... }:
{
imports = [
./bluetooth
@ -12,7 +12,7 @@
config = lib.mkMerge [
# Transparently enable home-manager profiles as well
(lib.optionalAttrs (type != "home") {
(lib.optionalAttrs (_class != "homeManager") {
home-manager.users.${config.my.user.name} = {
config = {
my = {

View file

@ -8,7 +8,7 @@ in
};
config = lib.mkIf cfg.enable (lib.mkMerge [
(lib.optionalAttrs (_class == "home") {
(lib.optionalAttrs (_class == "homeManager") {
# GTK theme configuration
my.home.gtk.enable = true;
})

View file

@ -8,7 +8,7 @@ in
};
config = lib.mkIf cfg.enable (lib.mkMerge [
(lib.optionalAttrs (_class == "home") {
(lib.optionalAttrs (_class == "homeManager") {
# Enable battery notifications
my.home.power-alert.enable = true;
})

View file

@ -16,7 +16,7 @@ in
config = lib.mkMerge [
(applyWm "i3" [
(lib.optionalAttrs (_class == "home") {
(lib.optionalAttrs (_class == "homeManager") {
# i3 settings
my.home.wm.windowManager = "i3";
# Screenshot tool

View file

@ -8,7 +8,7 @@ in
};
config = lib.mkIf cfg.enable (lib.mkMerge [
(lib.optionalAttrs (_class == "home") {
(lib.optionalAttrs (_class == "homeManager") {
# X configuration
my.home.x.enable = true;
})