nixos-dots

nixos dots
git clone git://popovic.xyz/nixos-dots.git
Log | Files | Refs

mika.nix (2303B)


      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;
     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/nix-zsh-plugins.zsh".text = ''
     62         source ${pkgs.zsh-fast-syntax-highlighting}/share/zsh/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh
     63         source ${pkgs.zsh-system-clipboard}/share/zsh/zsh-system-clipboard/zsh-system-clipboard.zsh
     64       '';
     65     };
     66   }
     67   // lib.optionalAttrs (!isDarwin || standalone) {
     68     homeDirectory = if isDarwin then "/Users/mika" else "/home/mika";
     69   };
     70 
     71   imports = [
     72     ../modules/firefox.nix
     73   ]
     74   ++ lib.optionals (isDarwin) [
     75     ../modules/kitty.nix
     76   ]
     77   ++ lib.optionals (!isDarwin) [
     78     ../modules/theme.nix
     79     ../modules/xdg.nix
     80     ../modules/mbsync_timer.nix
     81   ]
     82   ++ lib.optionals (isWayland) [
     83     ../modules/niri.nix
     84     ../modules/alacitty.nix
     85     ../modules/noctalia.nix
     86   ]
     87   ++ lib.optionals (standalone) [
     88     ../modules/nix_settings.nix
     89   ];
     90 
     91   xdg.configFile =
     92     let
     93       filteredDirs = builtins.filter (dir: dir != "systemd") configDirs;
     94     in
     95     lib.genAttrs filteredDirs (dir: {
     96       source = link "${dotfiles}/.config/${dir}";
     97       recursive = true;
     98       force = true;
     99     });
    100 
    101 }