[WIP] Refactor nix config

This commit is contained in:
Martin
2026-02-06 20:51:39 +01:00
parent f54655f3ae
commit 8ca8d55826
25 changed files with 2011 additions and 0 deletions

91
newnix/nix/flake.nix Normal file
View File

@@ -0,0 +1,91 @@
{
description = "Home Manager configuration of moustachioed";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nix-darwin = {
url = "github:LnL7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nix-darwin, nixpkgs, home-manager, ... }:
let
#system = "x86_64-darwin";
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
configuration = { pkgs, ... }: {
environment.systemPackages =
[
pkgs.vim
];
# Auto upgrade nix package and the daemon service.
services.nix-daemon.enable = true;
# nix.package = pkgs.nix;
nix.settings.experimental-features = "nix-command flakes";
programs.zsh.enable = true; # default shell on catalina
# Set Git commit hash for darwin-version.
system.configurationRevision = self.rev or self.dirtyRev or null;
# Used for backwards compatibility, please read the changelog before changing.
# $ darwin-rebuild changelog
system.stateVersion = 4;
# The platform the configuration will be used on.
nixpkgs.hostPlatform = system;
};
in {
# Build darwin flake using:
# $ darwin-rebuild build --flake .#Martins-MacBook-Pro
darwinConfigurations."Martins-MacBook-Pro" = nix-darwin.lib.darwinSystem {
modules = [ configuration ];
};
# Expose the package set, including overlays, for convenience.
darwinPackages = self.darwinConfigurations."Martins-MacBook-Pro".pkgs;
homeConfigurations = {
"moustachioed" = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [
./user/profiles/moustachioedBook.nix
./common.nix
./user/task_home.nix
];
};
"martin" = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [
./user/profiles/martin.nix
./common.nix
./user/task_home.nix
];
};
"pan" = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [
./user/profiles/work.nix
./common.nix
./user/task.nix
{
nixpkgs.config.allowUnfree = true;
}
];
};
};
};
}

13
newnix/nix/martin.nix Normal file
View File

@@ -0,0 +1,13 @@
{ config, pkgs, ... }:
{
home.username = "martin";
home.homeDirectory = "/Users/martin";
home.stateVersion = "24.05"; # Please read the comment before changing.
programs.git = {
userName = "Martin";
userEmail = "git@pander-on.de";
};
}