98 lines
2.1 KiB
Nix
98 lines
2.1 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";
|
|
};
|
|
};
|
|
outputs = inputs@{
|
|
nixpkgs,
|
|
home-manager,
|
|
emacs-overlay,
|
|
catppuccin,
|
|
...
|
|
}:
|
|
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 = [
|
|
({ 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
|
|
|
|
# Copying ./assets/config/.config to ~/.config
|
|
# Ensure the script is executable and available
|
|
environment.systemPackages = [ pkgs.bash ];
|
|
# Add the activation script
|
|
system.activationScripts.recreateConfig = lib.mkAfter "setupNetworking" ''
|
|
${self}/assets/scripts/recreate_config.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
|
|
];
|
|
};
|
|
};
|
|
|
|
}
|