diff options
| author | Mike Vink <ivi@vinkies.net> | 2024-02-07 02:09:45 +0100 |
|---|---|---|
| committer | Mike Vink <ivi@vinkies.net> | 2024-02-07 02:09:45 +0100 |
| commit | 276d84875219bb6a4b3f2e071192d2e85cab14ca (patch) | |
| tree | 71b919e6fa4a7ae8b356b40503ff63f268af2ca6 /profiles/core | |
| parent | 7c460caa6168fa95d526302d9186b9ffbd64d39c (diff) | |
fixup
Diffstat (limited to 'profiles/core')
| -rw-r--r-- | profiles/core/configuration.nix | 31 | ||||
| -rw-r--r-- | profiles/core/hm.nix | 5 | ||||
| -rw-r--r-- | profiles/core/home.nix | 39 |
3 files changed, 68 insertions, 7 deletions
diff --git a/profiles/core/configuration.nix b/profiles/core/configuration.nix index 87403eb..b5f5262 100644 --- a/profiles/core/configuration.nix +++ b/profiles/core/configuration.nix @@ -6,18 +6,41 @@ }: with lib; { imports = [ (mkAliasOptionModule [ "ivi" ] [ "users" "users" ivi.username ]) ]; + services = optionalAttrs (builtins.hasAttr "resolved" config.services) { + resolved.fallbackDns = [ + "1.1.1.1#one.one.one.one" + "1.0.0.1#one.one.one.one" + "2606:4700:4700::1111#one.one.one.one" + "2606:4700:4700::1001#one.one.one.one" + ]; + }; + security = optionalAttrs (builtins.hasAttr "sudo" config.security) { + sudo = { + wheelNeedsPassword = false; + extraConfig = '' + Defaults env_keep+="EDITOR" + Defaults env_keep+="SSH_CONNECTION SSH_CLIENT SSH_TTY" + Defaults env_keep+="http_proxy https_proxy" + ''; + }; + }; + time.timeZone = "Europe/Amsterdam"; users.users = { ${ivi.username} = { - home = "/Users/ivi"; + home = mkIf pkgs.stdenv.isDarwin "/Users/ivi"; uid = 1000; description = ivi.realName; openssh.authorizedKeys.keys = ivi.sshKeys; + } // optionalAttrs (!pkgs.stdenv.isDarwin) { + extraGroups = ["wheel" "networkmanager" "docker" "transmission"]; + isNormalUser = true; }; root = { openssh.authorizedKeys.keys = config.ivi.openssh.authorizedKeys.keys; }; }; + environment.systemPackages = with pkgs; [ man-pages man-pages-posix @@ -39,6 +62,12 @@ zoxide binwalk unzip + ] ++ optionals (!pkgs.stdenv.isDarwin) [ + pciutils + dnsutils + iputils + inetutils + usbutils ]; nix.package = pkgs.nixUnstable; diff --git a/profiles/core/hm.nix b/profiles/core/hm.nix index 9e5174d..76dd2e6 100644 --- a/profiles/core/hm.nix +++ b/profiles/core/hm.nix @@ -1,6 +1,5 @@ -{inputs, config, lib, ...}: with lib; { +{inputs, lib, pkgs, ...}: with lib; { imports = [ - inputs.home-manager.darwinModules.default (mkAliasOptionModule [ "hm" ] [ "home-manager" "users" ivi.username ]) ]; @@ -12,7 +11,7 @@ }; hm = { - home.stateVersion = "24.05"; + home.stateVersion = if pkgs.stdenv.isDarwin then "24.05" else config.system.stateVersion; home.enableNixpkgsReleaseCheck = false; systemd.user.startServices = "sd-switch"; diff --git a/profiles/core/home.nix b/profiles/core/home.nix index 5a659ae..fa2cd22 100644 --- a/profiles/core/home.nix +++ b/profiles/core/home.nix @@ -1,8 +1,9 @@ { + lib, config, pkgs, ... -}: { +}: with lib; { hm = { home.packages = with pkgs; [ github-cli @@ -12,7 +13,39 @@ # home.file.".local/bin".source = config.lib.meta.mkMutableSymlink /mut/bin; xdg = { enable = true; - mime.enable = false; + mime.enable = !pkgs.stdenv.isDarwin; + mimeApps = optionalAttrs (!pkgs.stdenv.isDarwin) { + enable = true; + defaultApplications = { + "text/x-shellscript" = ["text.desktop"]; + "application/x-bittorrent" = ["torrent.desktop"]; + "text/plain" = ["text.desktop"]; + "application/postscript" = ["pdf.desktop"]; + "application/pdf" = ["pdf.desktop"]; + "image/png" = ["img.desktop"]; + "image/jpeg" = ["img.desktop"]; + "image/gif" = ["img.desktop"]; + "application/rss+xml" = ["rss.desktop"]; + "video/x-matroska" = ["video.desktop"]; + "video/mp4" = ["video.desktop"]; + "x-scheme-handler/lbry" = ["lbry.desktop"]; + "inode/directory" = ["file.desktop"]; + "application/x-ica" = ["wfica.desktop"]; + "x-scheme-handler/magnet" = ["torrent.desktop"]; + "x-scheme-handler/mailto" = ["mail.desktop"]; + "x-scheme-handler/msteams" = ["teams.desktop"]; + }; + }; + desktopEntries = optionalAttrs (!pkgs.stdenv.isDarwin) { + text= { type = "Application"; name = "Text editor"; exec = "${pkgs.st}/bin/st -e kak %u"; }; + file = { type = "Application"; name = "File Manager"; exec = "${pkgs.st}/bin/st -e lfub %u"; }; + torrent = { type = "Application"; name = "Torrent"; exec = "${pkgs.coreutils}/bin/env transadd %U"; }; + img = { type = "Application"; name = "Image Viewer"; exec = "${pkgs.sxiv}/bin/sxiv -a %u"; }; + video = { type = "Application"; name = "Video Viewer"; exec = "${pkgs.mpv}/bin/mpv -quiet %f"; }; + mail = { type = "Application"; name = "Mail"; exec = "${pkgs.st}/bin/st -e neomutt %u"; }; + pdf = { type = "Application"; name = "PDF reader"; exec = "${pkgs.zathura}/bin/zathura %u"; }; + rss = { type = "Application"; name = "RSS feed addition"; exec = "${pkgs.coreutils}/bin/env rssadd %u"; }; + }; }; programs.ssh = { @@ -155,7 +188,7 @@ }; }; services.gpg-agent = { - enable = false; + enable = !pkgs.stdenv.isDarwin; enableSshSupport = true; defaultCacheTtl = 34550000; maxCacheTtl = 34550000; |
