mika.nix (2441B)
1 { 2 config, 3 pkgs, 4 lib, 5 inputs, 6 standalone ? false, 7 isDarwin ? pkgs.stdenv.isDarwin, 8 isWayland, 9 ... 10 }: 11 let 12 13 packageSets = import ../modules/packages.nix { inherit pkgs isDarwin; }; 14 15 link = config.lib.file.mkOutOfStoreSymlink; 16 inherit (import ../modules/dotfiles.nix) dotfiles nvim-config; 17 configDirs = builtins.attrNames (builtins.readDir "${dotfiles}/.config"); 18 in 19 { 20 nixpkgs = 21 if standalone then 22 { 23 config.allowUnfree = true; 24 overlays = [ inputs.niri.overlays.niri ]; 25 } 26 else 27 { }; 28 29 home = { 30 username = "mika"; 31 stateVersion = if isDarwin then "25.05" else "26.05"; 32 packages = lib.flatten ( 33 with packageSets; 34 [ 35 system 36 shell 37 cli 38 media 39 fileManagement 40 communication 41 network 42 office 43 fonts 44 email 45 development 46 ] 47 ++ lib.optionals (!isDarwin && !isWayland) [ xorg ] 48 ++ lib.optionals (isWayland) [ wayland ] 49 ); 50 51 file = { 52 ".zshenv" = { 53 source = link "${dotfiles}/.zshenv"; 54 force = true; 55 }; 56 ".local" = { 57 source = link "${dotfiles}/.local"; 58 recursive = true; 59 force = true; 60 }; 61 ".config/nvim" = { 62 source = link "${nvim-config}"; 63 recursive = true; 64 force = true; 65 }; 66 ".config/nix-zsh-plugins.zsh".text = '' 67 source ${pkgs.zsh-fast-syntax-highlighting}/share/zsh/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh 68 source ${pkgs.zsh-system-clipboard}/share/zsh/zsh-system-clipboard/zsh-system-clipboard.zsh 69 ''; 70 }; 71 } 72 // lib.optionalAttrs (!isDarwin || standalone) { 73 homeDirectory = if isDarwin then "/Users/mika" else "/home/mika"; 74 }; 75 76 imports = [ 77 ../modules/firefox.nix 78 ] 79 ++ lib.optionals (isDarwin) [ 80 ../modules/kitty.nix 81 ] 82 ++ lib.optionals (!isDarwin) [ 83 ../modules/theme.nix 84 ../modules/xdg.nix 85 ../modules/systemd-services.nix 86 ] 87 ++ lib.optionals (isWayland) [ 88 ../modules/niri.nix 89 ../modules/alacitty.nix 90 ../modules/noctalia.nix 91 ] 92 ++ lib.optionals (standalone) [ 93 ../modules/nix-settings.nix 94 ]; 95 96 xdg.configFile = 97 let 98 filteredDirs = builtins.filter (dir: dir != "systemd") configDirs; 99 in 100 lib.genAttrs filteredDirs (dir: { 101 source = link "${dotfiles}/.config/${dir}"; 102 recursive = true; 103 force = true; 104 }); 105 106 }