From aed227626109ca2e21263679477aa55936837e10 Mon Sep 17 00:00:00 2001 From: Alexandre Date: Fri, 29 May 2026 18:25:05 +0200 Subject: [PATCH] First attempt at dendritic pattern --- dendritic/flake.nix | 24 +++++++++++++ dendritic/modules/features/home-manager.nix | 15 ++++++++ .../modules/hosts/framework/configuration.nix | 36 +++++++++++++++++++ dendritic/modules/parts.nix | 13 +++++++ modules/home-manager/Rice/Niri/niri.nix | 10 +----- 5 files changed, 89 insertions(+), 9 deletions(-) create mode 100644 dendritic/flake.nix create mode 100644 dendritic/modules/features/home-manager.nix create mode 100644 dendritic/modules/hosts/framework/configuration.nix create mode 100644 dendritic/modules/parts.nix diff --git a/dendritic/flake.nix b/dendritic/flake.nix new file mode 100644 index 0000000..678087b --- /dev/null +++ b/dendritic/flake.nix @@ -0,0 +1,24 @@ +{ + description = "Dendritic flake"; + + inputs = { + nixpkgs = { + url = "github:NixOS/nixpkgs/nixos-unstable"; + }; + + flake-parts = { + url = "github:hercules-ci/flake-parts"; + }; + + import-tree = { + url = "github:vic/import-tree"; + }; + + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = inputs: inputs.flake-parts.lib.mkFlake { inherit inputs; } ( inputs.import-tree ./modules ); +} diff --git a/dendritic/modules/features/home-manager.nix b/dendritic/modules/features/home-manager.nix new file mode 100644 index 0000000..8f116e9 --- /dev/null +++ b/dendritic/modules/features/home-manager.nix @@ -0,0 +1,15 @@ +{ self, inputs, ... }: + +{ + # Home manager config + flake.nixosModules.homeManager = { pkgs, ... }: { + imports = [ + inputs.home-manager.nixosModules.default + ]; + + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + }; + }; +} diff --git a/dendritic/modules/hosts/framework/configuration.nix b/dendritic/modules/hosts/framework/configuration.nix new file mode 100644 index 0000000..4167db5 --- /dev/null +++ b/dendritic/modules/hosts/framework/configuration.nix @@ -0,0 +1,36 @@ +{ self, inputs, ... }: + +{ + flake.nixosConfigurations.framework = inputs.nixpkgs.lib.nixosSystem { + modules = [ + self.nixosModules.frameworkModule + self.nixosModules.homeManager + ]; + }; + + # The configuration.nix for system config + flake.nixosModules.frameworkModule = { pkgs, ... }: { + environment = { + systemPackages = [ + pkgs.neovim + pkgs.firefox + ]; + }; + + users = { + users = { + alex = { + isNormalUser = true; + shell = pkgs.zsh; + }; + }; + }; + + home-manager = { + users = { + alex = self.homeModules.alexModule; + }; + }; + }; + +} diff --git a/dendritic/modules/parts.nix b/dendritic/modules/parts.nix new file mode 100644 index 0000000..2521e52 --- /dev/null +++ b/dendritic/modules/parts.nix @@ -0,0 +1,13 @@ +{ inputs, ... }: + +{ + imports = [ + inputs.home-manager.flakeModules.home-manager + ]; + + config.systems = [ + "x86_64-linux" + "aarch64-darwin" + ]; + +} diff --git a/modules/home-manager/Rice/Niri/niri.nix b/modules/home-manager/Rice/Niri/niri.nix index 30ecf1b..27129c2 100644 --- a/modules/home-manager/Rice/Niri/niri.nix +++ b/modules/home-manager/Rice/Niri/niri.nix @@ -1,12 +1,4 @@ -{}: +{pkgs, ...}: { - programs.niri = { - enable = true; - config = { - input = { - focus-follows-mouse = null; - }; - }; - }; }