mirror of
https://github.com/Jokiller230/puzzlevision.git
synced 2025-01-18 09:53:06 +01:00
⚗️🚧 (modules/flake) Update easy-hosts config and flake module args
This commit is contained in:
parent
ecfbc9baf6
commit
e54b87a835
10 changed files with 85 additions and 49 deletions
|
@ -53,4 +53,9 @@ Parts of this flake were inspired by the likes of:
|
|||
- [isabelroses](https://github.com/isabelroses)
|
||||
- [uncenter](https://github.com/uncenter)
|
||||
|
||||
Many thanks to their hard work!
|
||||
and documentations such as:
|
||||
|
||||
- [flake-parts](https://flake.parts)
|
||||
- [NixOS and Flakes book](https://nixos-and-flakes.thiscute.world)
|
||||
|
||||
many thanks to their hard work!
|
||||
|
|
18
flake.nix
18
flake.nix
|
@ -3,29 +3,31 @@
|
|||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
easy-hosts.url = "github:isabelroses/easy-hosts";
|
||||
|
||||
# Flake parts, a library that provides utilites for creating flakes
|
||||
flake-parts = {
|
||||
url = "github:hercules-ci/flake-parts";
|
||||
inputs.nixpkgs-lib.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
# Provides an easy interface for loading systems from a directory
|
||||
easy-hosts.url = "github:isabelroses/easy-hosts";
|
||||
|
||||
#
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
url = "github:nix-community/home-manager";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = inputs@{ flake-parts, ... }:
|
||||
flake-parts.lib.mkFlake { inherit inputs; } {
|
||||
debug = true;
|
||||
|
||||
imports = [
|
||||
./systems
|
||||
./modules/flake
|
||||
];
|
||||
|
||||
systems = [ "x86_64-linux" ];
|
||||
flake = {
|
||||
# Exposing the flake namespace
|
||||
namespace = "puzzlevision";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
{}
|
|
@ -1 +0,0 @@
|
|||
{}
|
20
modules/flake/arguments.nix
Normal file
20
modules/flake/arguments.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
inputs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
{
|
||||
# Overwrite and add new arguments to all flake modules.
|
||||
_module.args = {
|
||||
namespace = config.flake.namespace;
|
||||
|
||||
# Initialize nixpkgs instance with custom overlays.
|
||||
pkgs = import inputs.nixpkgs {
|
||||
overlays = [
|
||||
(final: prev: {
|
||||
# Todo: actually append overlays from "/overlays/overlay-name/default.nix" files.
|
||||
})
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
10
modules/flake/default.nix
Normal file
10
modules/flake/default.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
imports = [
|
||||
# Automagically imports overlays from "/overlays/overlay-name" and applies them to pkgs.
|
||||
# Also applies some other useful arguments, like namespace, to all flake modules.
|
||||
./arguments.nix
|
||||
|
||||
# Automagically imports systems from "/systems/arch-classname/system-name".
|
||||
./systems.nix
|
||||
];
|
||||
}
|
30
modules/flake/systems.nix
Normal file
30
modules/flake/systems.nix
Normal file
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
inputs,
|
||||
namespace,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [ inputs.easy-hosts.flakeModule ];
|
||||
|
||||
easyHosts = {
|
||||
autoConstruct = true;
|
||||
path = ../../systems;
|
||||
|
||||
shared = {
|
||||
specialArgs = {
|
||||
inherit namespace;
|
||||
};
|
||||
};
|
||||
|
||||
perClass = class: {
|
||||
modules = [
|
||||
# Import modules based on current classname.
|
||||
../${class}
|
||||
|
||||
(inputs.nixpkgs.lib.optionals (class == "nixos") [
|
||||
inputs.home-manager.nixosModules.default
|
||||
])
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
{}
|
|
@ -1,30 +0,0 @@
|
|||
{
|
||||
lib,
|
||||
self,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [ inputs.easy-hosts.flakeModule ];
|
||||
|
||||
easyHosts = {
|
||||
autoConstruct = true;
|
||||
path = ../systems;
|
||||
|
||||
shared.modules = [
|
||||
../homes
|
||||
];
|
||||
|
||||
perClass =
|
||||
class:
|
||||
{
|
||||
modules = [
|
||||
"${self}/modules/${class}"
|
||||
|
||||
(lib.optionals (class == "nixos") [
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
])
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
|
@ -7,18 +7,20 @@
|
|||
./hardware.nix
|
||||
];
|
||||
|
||||
# Todo: pass a set of users to enable from within easy-hosts and automatically map the corresponding home-manager configurations
|
||||
# ${namespace} = {
|
||||
# mainUser = "jo";
|
||||
# users = [ "jo" ];
|
||||
# };
|
||||
users.users.jo.isNormalUser = true;
|
||||
users.users.jo.initialPassword = "balls";
|
||||
users.users.jo.createHome = true;
|
||||
|
||||
# Enable Plasma6
|
||||
services.xserver.enable = true;
|
||||
services.displayManager.sddm.wayland.enable = true;
|
||||
services.desktopManager.plasma6.enable = true;
|
||||
|
||||
# Todo: pass a set of users to enable from within easy-hosts and automatically map the corresponding home-manager configurations
|
||||
# Register "jo" as a user
|
||||
users.users.jo.isNormalUser = true;
|
||||
users.users.jo.extraGroups = [ "dialout" "docker" ];
|
||||
users.users.jo.initialPassword = "balls";
|
||||
users.users.jo.createHome = true;
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
ghostty
|
||||
];
|
||||
|
|
Loading…
Reference in a new issue