117 lines
2.9 KiB
Nix
117 lines
2.9 KiB
Nix
{
|
|
description = "Henrov's nixos configuration";
|
|
inputs = {
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
|
home-manager = {
|
|
url = "github:nix-community/home-manager";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
emacs-overlay = {
|
|
url = "github:nix-community/emacs-overlay";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
catppuccin = {
|
|
url = "github:catppuccin/nix";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
zen-browser = {
|
|
url = "github:youwen5/zen-browser-flake";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
hyprland.url = "github:hyprwm/Hyprland";
|
|
};
|
|
outputs = inputs@{
|
|
nixpkgs,
|
|
home-manager,
|
|
emacs-overlay,
|
|
catppuccin,
|
|
hyprland,
|
|
...
|
|
}:
|
|
let
|
|
user = import ./user.nix;
|
|
lib = nixpkgs.lib;
|
|
machines = [
|
|
"traveldroid"
|
|
];
|
|
pkgs = import nixpkgs {
|
|
inherit (user) system;
|
|
};
|
|
in
|
|
{
|
|
nixosConfigurations = builtins.listToAttrs (
|
|
builtins.map (machine: {
|
|
name = machine;
|
|
value = lib.nixosSystem {
|
|
modules = [
|
|
# Start_script.nix
|
|
({ lib, config, pkgs, ... }: {
|
|
imports = [ ./start_script.nix ];
|
|
})
|
|
# Hyprland configuratie
|
|
hyprland.nixosModules.default
|
|
({ config, pkgs, inputs, ... }: {
|
|
programs.hyprland = {
|
|
enable = true;
|
|
package = hyprland.packages.${pkgs.system}.hyprland;
|
|
};
|
|
})
|
|
({ lib, ... }: {
|
|
nixpkgs.overlays = [ emacs-overlay.overlays.default ];
|
|
})
|
|
./machines/${machine}/configuration.nix
|
|
home-manager.nixosModules.home-manager
|
|
{
|
|
home-manager.useGlobalPkgs = true;
|
|
home-manager.useUserPackages = true;
|
|
|
|
home-manager.extraSpecialArgs = {
|
|
inherit user inputs;
|
|
flakeRoot.outPath= inputs.self;
|
|
};
|
|
|
|
home-manager.backupFileExtension = "backup";
|
|
home-manager.users.${user.username} = {
|
|
imports = [
|
|
./machines/${machine}/home.nix
|
|
catppuccin.homeModules.catppuccin
|
|
];
|
|
};
|
|
}
|
|
|
|
catppuccin.nixosModules.catppuccin # theme
|
|
|
|
# end_script as a systemd service
|
|
({ lib, config, pkgs, ... }: {
|
|
systemd.user.services.endScript = lib.mkIf (builtins.pathExists ./assets/scripts/end_script.sh) {
|
|
description = "Run end script after Home Manager";
|
|
wantedBy = [ "multi-user.target" ];
|
|
after = [ "home-manager-activate.service" ];
|
|
serviceConfig.Type = "oneshot";
|
|
script = ''
|
|
${./assets/scripts/end_script.sh}
|
|
'';
|
|
};
|
|
})
|
|
];
|
|
|
|
specialArgs = {
|
|
hostname = machine;
|
|
inherit user;
|
|
inherit inputs;
|
|
flakeRoot.outPath= inputs.self;
|
|
};
|
|
};
|
|
}) machines
|
|
);
|
|
|
|
devShells.${user.system}.default = pkgs.mkShell {
|
|
buildInputs = with pkgs; [
|
|
nil
|
|
nixfmt-rfc-style
|
|
];
|
|
};
|
|
};
|
|
|
|
}
|