[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

86
newnix/flake.lock generated Normal file
View File

@@ -0,0 +1,86 @@
{
"nodes": {
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1767039857,
"narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1770318660,
"narHash": "sha256-yFVde8QZK7Dc0Xa8eQDsmxLX4NJNfL1NKfctSyiQgMY=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "471e6a065f9efed51488d7c51a9abbd387df91b8",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"nixos-wsl": {
"inputs": {
"flake-compat": "flake-compat",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1769217863,
"narHash": "sha256-RY9kJDXD6+2Td/59LkZ0PFSereCXHdBX9wIkbYjRKCY=",
"owner": "nix-community",
"repo": "NixOS-WSL",
"rev": "38a5250e57f583662eac3b944830e4b9e169e965",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "NixOS-WSL",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1770197578,
"narHash": "sha256-AYqlWrX09+HvGs8zM6ebZ1pwUqjkfpnv8mewYwAo+iM=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "00c21e4c93d963c50d4c0c89bfa84ed6e0694df2",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"home-manager": "home-manager",
"nixos-wsl": "nixos-wsl",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

44
newnix/flake.nix Normal file
View File

@@ -0,0 +1,44 @@
{
description = "NixOS Shared Configuration";
inputs = {
# Use nixos-unstable for latest packages
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
# NixOS-WSL for WSL-specific functionality
nixos-wsl = {
url = "github:nix-community/NixOS-WSL";
inputs.nixpkgs.follows = "nixpkgs";
};
# Home Manager for user configuration
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, nixos-wsl, home-manager, ... }:
let
system = "x86_64-linux";
in
{
nixosConfigurations = {
nix = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
nixos-wsl.nixosModules.wsl
./hosts/work/configuration.nix
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.pan = import ./hosts/work/home.nix;
}
];
};
};
};
}

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";
};
}

View File

@@ -0,0 +1,71 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page, on
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
# NixOS-WSL specific options are documented on the NixOS-WSL repository:
# https://github.com/nix-community/NixOS-WSL
{ config, lib, pkgs, ... }:
{
wsl.enable = true;
wsl.defaultUser = "pan";
wsl.interop.register = true;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. It's perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "25.05"; # Did you read the comment?
networking.hostName = "nix";
#networking.networkmanager.enable = true;
time.timeZone = "Europe/Berlin"; # Adjust to your timezone
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "de_DE.UTF-8";
LC_IDENTIFICATION = "de_DE.UTF-8";
LC_MEASUREMENT = "de_DE.UTF-8";
LC_MONETARY = "de_DE.UTF-8";
LC_NAME = "de_DE.UTF-8";
LC_NUMERIC = "de_DE.UTF-8";
LC_PAPER = "de_DE.UTF-8";
LC_TELEPHONE = "de_DE.UTF-8";
LC_TIME = "de_DE.UTF-8";
};
users.users.pan = {
isNormalUser = true;
extraGroups = [ "networkmanager" "wheel" ];
uid = 1000;
shell = pkgs.zsh;
};
programs.zsh.enable = true;
nix.settings = {
experimental-features = [ "nix-command" "flakes" ];
};
nixpkgs.config.allowUnfree = true;
nix.gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 7d";
};
# Automatic Store Optimization
nix.settings.auto-optimise-store = true;
environment.systemPackages = with pkgs; [
git
wget
curl
vim
];
}

View File

@@ -0,0 +1,48 @@
{
description = "NixOS-WSL configuration for pan";
inputs = {
# Use nixos-unstable for latest packages
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
# NixOS-WSL for WSL-specific functionality
nixos-wsl = {
url = "github:nix-community/NixOS-WSL";
inputs.nixpkgs.follows = "nixpkgs";
};
# Home Manager for user configuration
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, nixos-wsl, home-manager, ... }:
let
system = "x86_64-linux";
in
{
nixosConfigurations = {
# Use your hostname: "nix"
nix = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
# NixOS-WSL module
nixos-wsl.nixosModules.wsl
# System configuration
./configuration.nix
# Home Manager as NixOS module
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.pan = import ./home.nix;
}
];
};
};
};
}

View File

@@ -0,0 +1,30 @@
{ config, pkgs, ... }:
{
home.username = "pan";
home.homeDirectory = "/home/pan";
home.stateVersion = "23.11"; # Please read the comment before changing.
programs.git.settings.user = {
name = "Martin Pander";
email = "martin.pander@knowtion.de";
};
programs.jujutsu.settings.user = {
name = "Martin Pander";
email = "martin.pander@knowtion.de";
};
home.packages = with pkgs; [
yaml-language-server
marksman
dockerfile-language-server
];
programs.zsh.profileExtra = ''
source $HOME/.profile
'';
}

View File

@@ -0,0 +1,64 @@
{ config, lib, pkgs, ... }:
{
wsl.enable = true;
wsl.defaultUser = "pan";
wsl.interop.register = true;
networking.hostName = "nix";
#networking.networkmanager.enable = true;
time.timeZone = "Europe/Berlin"; # Adjust to your timezone
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "de_DE.UTF-8";
LC_IDENTIFICATION = "de_DE.UTF-8";
LC_MEASUREMENT = "de_DE.UTF-8";
LC_MONETARY = "de_DE.UTF-8";
LC_NAME = "de_DE.UTF-8";
LC_NUMERIC = "de_DE.UTF-8";
LC_PAPER = "de_DE.UTF-8";
LC_TELEPHONE = "de_DE.UTF-8";
LC_TIME = "de_DE.UTF-8";
};
users.users.pan = {
isNormalUser = true;
extraGroups = [ "networkmanager" "wheel" ];
uid = 1000;
shell = pkgs.zsh;
};
programs.zsh.enable = true;
nix.settings = {
experimental-features = [ "nix-command" "flakes" ];
};
nixpkgs.config.allowUnfree = true;
nix.gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 7d";
};
# Automatic Store Optimization
nix.settings.auto-optimise-store = true;
environment.systemPackages = with pkgs; [
git
wget
curl
vim
];
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. It's perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "25.05"; # Did you read the comment?
}

View File

@@ -0,0 +1,48 @@
{
description = "NixOS-WSL configuration for pan";
inputs = {
# Use nixos-unstable for latest packages
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
# NixOS-WSL for WSL-specific functionality
nixos-wsl = {
url = "github:nix-community/NixOS-WSL";
inputs.nixpkgs.follows = "nixpkgs";
};
# Home Manager for user configuration
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, nixos-wsl, home-manager, ... }:
let
system = "x86_64-linux";
in
{
nixosConfigurations = {
# Use your hostname: "nix"
nix = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
# NixOS-WSL module
nixos-wsl.nixosModules.wsl
# System configuration
./configuration.nix
# Home Manager as NixOS module
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.pan = import ./home.nix;
}
];
};
};
};
}

View File

@@ -0,0 +1,45 @@
{ config, pkgs, lib, ... }:
{
imports = [
./modules/home/default.nix
./modules/tmux.nix
./modules/git.nix
./modules/dev.nix
./modules/nvim.nix
./modules/task.nix
];
# User details
home.username = "pan";
home.homeDirectory = "/home/pan";
# Git and Jujutsu user configuration
programs.git.settings.user = {
name = "Martin Pander";
email = "martin.pander@knowtion.de";
};
programs.jujutsu.settings.user = {
name = "Martin Pander";
email = "martin.pander@knowtion.de";
};
home.packages = with pkgs; [
nix-ld
];
# NIX_LD settings for running non-Nix binaries
# home.sessionVariables = {
# NIX_LD_LIBRARY_PATH = with pkgs; lib.makeLibraryPath [
# stdenv.cc.cc
# zlib
# ];
# NIX_LD = lib.fileContents "${pkgs.stdenv.cc}/nix-support/dynamic-linker";
# };
# This value determines the Home Manager release which the configuration is
# compatible with. This helps avoid breakage when a new Home Manager release
# introduces backwards incompatible changes.
home.stateVersion = "25.05";
}

View File

@@ -0,0 +1,26 @@
{ config, pkgs, lib, ... }:
{
imports = [
./sh.nix
./tmux.nix
./git.nix
./dev.nix
./nvim.nix
./task.nix
];
home.packages = with pkgs; [
nil # Nix LSP
nerd-fonts.fira-code
# Language servers
yaml-language-server
marksman
dockerfile-language-server
];
news.display = "silent";
programs.home-manager.enable = true;
}

View File

@@ -0,0 +1,14 @@
{ config, pkgs, ... }:
{
programs.direnv = {
enable = true;
enableZshIntegration = true;
nix-direnv.enable = true;
};
home.packages = with pkgs; [
visidata
bubblewrap
];
}

View File

@@ -0,0 +1,88 @@
{ config, pkgs, ... }:
{
programs.git = {
enable = true;
settings = {
alias = {
st = "status";
ci = "commit";
co = "checkout";
br = "branch";
pl = "pull";
ps = "push";
sw = "switch";
mno =" merge --no-ff";
lg = "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%C(bold blue)<%an>%Creset' --abbrev-commit";
cleanup = "!git fetch --prune && git branch -vv | grep ': gone]' | awk '{print $1}' | xargs git branch -D";
};
column.ui = "auto";
branch.sort = "-committerdate";
tag.sort = "version:refname";
diff = {
algorithm = "histogram";
colorMoved = "plain";
mnemonicPrefix = "true";
renames = "true";
};
pull.rebase = "true";
push = {
default = "simple";
autoSetupRemote = "true";
followTags = "true";
};
fetch = {
prune = "true";
pruneTags = "true";
all = "true";
};
help.autocorrect = "prompt";
commit.verbose = "true";
rerere = {
enabled = "true";
autoupdate = "true";
};
rebase = {
autoSquas = "true";
autoStash = "true";
updateRefs = "true";
};
merge.conflictstyle = "zdiff3";
core.editor = "nvim";
init.defaultBranch = "main";
};
ignores = [
".direnv/"
".envrc"
];
};
programs.difftastic = {
enable = true;
git.enable = true;
};
programs.lazygit = {
enable = true;
settings = {
theme.lightTheme = "true";
git = {
log = {
format = "%C(yellow)%h%Creset %C(bold blue)<%an>%Creset %s %Cgreen(%cr)%Creset";
graph = "true";
};
};
};
};
programs.jujutsu = {
enable = true;
settings = {
aliases = {
tug = ["bookmark" "move" "--from" "heads(::@- & bookmarks())" "--to" "@-"];
};
};
};
}

View File

@@ -0,0 +1,9 @@
{ config, pkgs, ... }:
{
home.packages = with pkgs; [
claude-code
opencode
gemini-cli
];
}

View File

@@ -0,0 +1,85 @@
{ config, pkgs, lib, ... }:
{
programs.neovim = {
enable = true;
defaultEditor = true;
vimAlias = true;
plugins = with pkgs.vimPlugins; [
vim-repeat
vim-surround
ts-comments-nvim
vim-fugitive
gitsigns-nvim
nvim-tree-lua
targets-vim
mini-pairs
mini-align
mini-bracketed
mini-splitjoin
mini-move
mini-ai
mini-icons
flash-nvim
trouble-nvim
conform-nvim
nvim-lint
promise-async
nvim-ufo
vim-windowswap
plenary-nvim
telescope-nvim
telescope-fzf-native-nvim
telescope-ui-select-nvim
yanky-nvim
lualine-nvim
undotree
luasnip
nvim-cmp
cmp_luasnip
cmp-buffer
cmp-path
cmp-cmdline
cmp-nvim-lsp
cmp-nvim-lsp-signature-help
cmp_yanky
cmp-git
nvim-lspconfig
lspkind-nvim
copilot-lua
copilot-cmp
CopilotChat-nvim
bullets-vim
nvim-dap
nvim-nio
nvim-dap-ui
nvim-dap-virtual-text
nvim-dap-go
nvim-dap-python
nvim-dap-lldb
todo-comments-nvim
vim-markdown
zen-mode-nvim
plantuml-syntax
obsidian-nvim
render-markdown-nvim
image-nvim
img-clip-nvim
vim-nix
(nvim-treesitter.withPlugins (p: [ p.awk p.bash p.c p.c_sharp p.cpp p.css p.diff p.dockerfile p.doxygen p.git_config p.gitcommit p.go p.gomod p.gosum p.gotmpl p.helm p.haskell p.html p.http p.java p.javascript p.json p.latex p.lua p.markdown p.markdown_inline p.matlab p.nix p.printf p.python p.regex p.rust p.sql p.strace p.supercollider p.svelte p.swift p.terraform p.tmux p.toml p.typescript p.vim p.xml p.yaml p.zig ]))
];
initLua = builtins.concatStringsSep "\n" [
(lib.strings.fileContents ../../../nvim/base.lua)
(lib.strings.fileContents ../../../nvim/keymaps.lua)
(lib.strings.fileContents ../../../nvim/plugins.lua)
(lib.strings.fileContents ../../../nvim/filetype.lua)
];
};
home.packages = with pkgs; [
nodejs-slim
];
}

View File

@@ -0,0 +1,99 @@
{ config, pkgs, lib, ... }:
{
programs.zsh = {
enable = true;
enableCompletion = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
history.size = 500000;
prezto = {
enable = true;
caseSensitive = true;
color = true;
editor = {
dotExpansion = true;
keymap = "vi";
};
pmodules = [
"environment"
"terminal"
"editor"
"history"
"directory"
"spectrum"
"utility"
"completion"
"syntax-highlighting"
"history-substring-search"
"prompt"
"git"
];
prompt.theme = "minimal";
syntaxHighlighting.highlighters = [
"main"
"brackets"
"pattern"
"line"
"cursor"
"root"
];
tmux = {
autoStartLocal = true;
itermIntegration = true;
};
};
initContent = ''
HISTCONTROL='erasedups:ignoreboth'
HISTIGNORE='&:[ ]*:exit:ls:bg:fg:history:clear'
unsetopt beep
'';
profileExtra = ''
source $HOME/.profile
'';
};
programs.fzf = {
enable = true;
enableZshIntegration = true;
};
programs.lsd = {
enable = true;
enableZshIntegration = true;
};
programs.zoxide = {
enable = true;
enableZshIntegration = true;
options = [
"--cmd cd"
];
};
programs.bat.enable = true;
programs.ripgrep.enable = true;
programs.btop.enable = true;
programs.ranger.enable = true;
home.packages = with pkgs; [
fd
dust
glow
ripgrep-all
viddy
duf
];
home.sessionVariables = {
BAT_THEME = "Coldark-Cold";
};
home.shellAliases = {
lst = "lsd --tree";
};
}

View File

@@ -0,0 +1,75 @@
{config, pkgs, lib, ...}:
{
programs.taskwarrior = {
enable = true;
colorTheme = "light-256";
package = pkgs.taskwarrior3;
config = {
weekstart = "monday";
uda.tasksquire.tags.default="code,comm,cust,del,doc,mngmnt,ops,rsrch,rvw,track";
uda.parenttask.type="string";
uda.parenttask.label="Parent";
uda.energy.type="string";
uda.energy.label="Energy";
uda.energy.values="h,m,l";
uda.energy.default="m";
uda.priority.values = "H,M,,L";
urgency.uda.priority.L.coefficient = -0.5;
urgency.user.tag.deferred.coefficient = -15.0;
urgency.user.tag.cust.coefficient = 5.0;
urgency.user.tag.fixed.coefficient = -100.0;
report.next.columns="id,start.age,entry.age,depends,priority,energy,project,tags,recur,scheduled.countdown,due.relative,until.remaining,description,urgency";
report.next.labels="ID,Active,Age,Deps,P,E,Project,Tag,Recur,S,Due,Until,Description,Urg";
report.next.filter="status:pending -WAITING -deferred -track";
report.time.columns="id,start.age,entry.age,depends,priority,energy,project,tags,recur,scheduled.countdown,due.relative,until.remaining,description,urgency";
report.time.labels="ID,Active,Age,Deps,P,E,Project,Tag,Recur,S,Due,Until,Description,Urg";
report.time.filter="status:pending -WAITING -deferred +fixed";
report.deferred.columns="id,start.age,entry.age,depends,priority,energy,project,tags,recur,scheduled.countdown,due.relative,until.remaining,description,urgency";
report.deferred.context="1";
report.deferred.description="Deferred and waiting tasks";
report.deferred.labels="ID,Active,Age,Deps,P,E,Project,Tag,Recur,S,Due,Until,Description,Urg";
report.deferred.filter="status:pending +deferred";
report.deferred.sort="urgency-";
report.low.columns="id,start.age,entry.age,depends,priority,energy,project,tags,recur,scheduled.countdown,due.relative,until.remaining,description,urgency";
report.low.context="1";
report.low.description="Low energy tasks";
report.low.filter="status:pending -WAITING -deferred";
report.low.labels="ID,Active,Age,Deps,P,E,Project,Tag,Recur,S,Due,Until,Description,Urg";
report.low.sort="energy+,urgency-";
context.today.read = "(prio:H or +next)";
context.today.write = "prio:H +next";
context.deferred.read = "+deferred";
context.deferred.write = "+deferred";
context.customer.read = "+cust";
context.customer.write = "+cust";
context.low_energy.read = "+low";
context.low_energy.write = "+low";
uda.taskwarrior-tui.task-report.show-info = false;
uda.taskwarrior-tui.selection.reverse = "yes";
};
};
home.packages = with pkgs; [
taskwarrior-tui
timewarrior
];
home.shellAliases = lib.mkMerge [ {
t = "task";
tt = "taskwarrior-tui";
tw = "timew";
tws = "timew summary :ids";
}
];
}

View File

@@ -0,0 +1,73 @@
{ config, pkgs, lib, ... }:
{
programs.tmux = {
enable = true;
shortcut = "a";
mouse = true;
keyMode = "vi";
escapeTime = 0;
terminal = "screen-256color";
tmuxp.enable = true;
extraConfig = ''
set -g display-time 1500
unbind S
bind S command-prompt "switch -t %1"
bind-key -n M-K switch-client -p
bind-key -n M-J switch-client -n
bind-key -n M-L next-window
bind-key -n M-H previous-window
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind c new-window -a -c "#{pane_current_path}"
bind C-s display-popup -E "zsh ~/bin/tmuxp_selector.sh"
bind C-g display-popup -E -d "#{pane_current_path}" -xC -yC -w 95% -h 95% "lazygit"
bind C-t display-popup -E -xC -yC -w 95% -h 95% "tasksquire"
# Note: The following keybindings had hard-coded WSL paths that were removed.
# Adjust the paths below to match your NixOS environment:
# bind C-n display-popup -E -xC -yC -w 95% -h 95% -d "~/Documents/notes/Work/" "vim quick_notes.md"
# bind C-p display-popup -E -xC -yC -w 95% -h 95% -d "~/Documents/notes/Work/development/" "vim mbpr.md"
#######################################
# status line
#######################################
set -g status-justify centre
set -g status-left "#[bg=#808080,fg=#ffffff,bold] #S #[default]#[bg=#BCBCBC] #{-30:pane_title} "
set -g status-left-length 40
set -g status-right "#[bg=#BCBCBC] %H:%M #[bg=#808080,fg=#ffffff] %d.%m.%y "
# setw -g window-status-format " #W#F "
# setw -g window-status-current-format " #W#F "
setw -g window-status-format " #W "
setw -g window-status-current-format " #W "
setw -g window-status-separator ""
#######################################
# colors, taken from vim-lucius
#######################################
set -g status-style "bg=#DADADA,fg=#000000"
setw -g window-status-style "bg=#BCBCBC,fg=#000000"
setw -g window-status-current-style "bg=#808080,fg=#ffffff"
setw -g window-status-activity-style "bg=#AFD7AF,fg=#000000"
setw -g window-status-bell-style "bg=#AFD7AF,fg=#000000"
#setw -g window-status-content-style "bg=#AFD7AF,fg=#000000"
set -g pane-active-border-style "bg=#eeeeee,fg=#006699"
set -g pane-border-style "bg=#eeeeee,fg=#999999"
'';
};
home.shellAliases = {
"o" = "tmuxp";
"ol" = "tmuxp load";
};
}

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";
};
}

View File

@@ -0,0 +1,41 @@
{ config, lib, pkgs, ... }:
{
time.timeZone = "Europe/Berlin"; # Adjust to your timezone
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "de_DE.UTF-8";
LC_IDENTIFICATION = "de_DE.UTF-8";
LC_MEASUREMENT = "de_DE.UTF-8";
LC_MONETARY = "de_DE.UTF-8";
LC_NAME = "de_DE.UTF-8";
LC_NUMERIC = "de_DE.UTF-8";
LC_PAPER = "de_DE.UTF-8";
LC_TELEPHONE = "de_DE.UTF-8";
LC_TIME = "de_DE.UTF-8";
};
programs.zsh.enable = true;
nix.settings = {
experimental-features = [ "nix-command" "flakes" ];
};
nixpkgs.config.allowUnfree = true;
nix.gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 7d";
};
nix.settings.auto-optimise-store = true;
environment.systemPackages = with pkgs; [
git
wget
curl
vim
];
}