diff --git a/flake.lock b/flake.lock index b38020b4..3f47932e 100644 --- a/flake.lock +++ b/flake.lock @@ -69,7 +69,9 @@ "nixpkgs": [ "nixpkgs" ], - "systems": "systems" + "systems": [ + "systems" + ] }, "locked": { "lastModified": 1721048365, @@ -87,14 +89,18 @@ }, "agenix": { "inputs": { - "darwin": "darwin", + "darwin": [ + "darwin" + ], "home-manager": [ "home-manager" ], "nixpkgs": [ "nixpkgs" ], - "systems": "systems_2" + "systems": [ + "systems" + ] }, "locked": { "lastModified": 1720546205, @@ -162,42 +168,43 @@ "darwin": { "inputs": { "nixpkgs": [ - "agenix", "nixpkgs" ] }, "locked": { - "lastModified": 1700795494, - "narHash": "sha256-gzGLZSiOhf155FW7262kdHo2YDeugp3VuIFb4/GGng0=", + "lastModified": 1720845312, + "narHash": "sha256-yPhAsJTpyoIPQZJGC8Fw8W2lAXyhLoTn+HP20bmfkfk=", "owner": "lnl7", "repo": "nix-darwin", - "rev": "4b9b83d5a92e8c1fbfd8eb27eda375908c11ec4d", + "rev": "5ce8503cf402cf76b203eba4b7e402bea8e44abc", "type": "github" }, "original": { "owner": "lnl7", - "ref": "master", "repo": "nix-darwin", "type": "github" } }, "devshell": { "inputs": { - "flake-utils": "flake-utils", + "flake-utils": [ + "flake-utils" + ], "nixpkgs": [ "nixpkgs" ] }, "locked": { - "lastModified": 1717408969, - "narHash": "sha256-Q0OEFqe35fZbbRPPRdrjTUUChKVhhWXz3T9ZSKmaoVY=", - "owner": "numtide", + "lastModified": 1721051506, + "narHash": "sha256-E31R7SYC7rGmVL4tdkpckIW1od2hVpg/FYqAKPLjnhE=", + "owner": "chvp", "repo": "devshell", - "rev": "1ebbe68d57457c8cae98145410b164b5477761f4", + "rev": "58180de0a0349c7dae5f100c576ec27fbd504fd4", "type": "github" }, "original": { - "owner": "numtide", + "owner": "chvp", + "ref": "ruby-darwin-fix", "repo": "devshell", "type": "github" } @@ -281,25 +288,9 @@ }, "flake-utils": { "inputs": { - "systems": "systems_3" - }, - "locked": { - "lastModified": 1701680307, - "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_2": { - "inputs": { - "systems": "systems_4" + "systems": [ + "systems" + ] }, "locked": { "lastModified": 1710146030, @@ -315,9 +306,9 @@ "type": "github" } }, - "flake-utils_3": { + "flake-utils_2": { "inputs": { - "systems": "systems_5" + "systems": "systems" }, "locked": { "lastModified": 1681202837, @@ -380,7 +371,7 @@ "crane": "crane", "flake-compat": "flake-compat", "flake-parts": "flake-parts", - "flake-utils": "flake-utils_3", + "flake-utils": "flake-utils_2", "nixpkgs": [ "nixpkgs" ], @@ -560,15 +551,17 @@ "accentor-api": "accentor-api", "accentor-web": "accentor-web", "agenix": "agenix", + "darwin": "darwin", "devshell": "devshell", "emacs-overlay": "emacs-overlay", - "flake-utils": "flake-utils_2", + "flake-utils": "flake-utils", "home-manager": "home-manager", "lanzaboote": "lanzaboote", "nix-index-database": "nix-index-database", "nixos-mailserver": "nixos-mailserver", "nixpkgs": "nixpkgs", "nur": "nur", + "systems": "systems_2", "tetris": "tetris", "www-chvp-be": "www-chvp-be" } @@ -643,51 +636,6 @@ "type": "github" } }, - "systems_4": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, - "systems_5": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, - "systems_6": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, "tetris": { "inputs": { "devshell": [ @@ -725,7 +673,7 @@ "nixpkgs": [ "nixpkgs" ], - "systems": "systems_6" + "systems": "systems_3" }, "locked": { "host": "git.chvp.be", diff --git a/flake.nix b/flake.nix index 158cafcc..cdcfd422 100644 --- a/flake.nix +++ b/flake.nix @@ -26,19 +26,29 @@ devshell.follows = "devshell"; flake-utils.follows = "flake-utils"; nixpkgs.follows = "nixpkgs"; + systems.follows = "systems"; }; }; agenix = { url = "github:ryantm/agenix"; inputs = { + darwin.follows = "darwin"; home-manager.follows = "home-manager"; nixpkgs.follows = "nixpkgs"; + systems.follows = "systems"; }; }; - devshell = { - url = "github:numtide/devshell"; + darwin = { + url = "github:lnl7/nix-darwin"; inputs.nixpkgs.follows = "nixpkgs"; }; + devshell = { + url = "github:chvp/devshell/ruby-darwin-fix"; + inputs = { + nixpkgs.follows = "nixpkgs"; + flake-utils.follows = "flake-utils"; + }; + }; emacs-overlay = { url = "github:nix-community/emacs-overlay"; inputs = { @@ -46,7 +56,10 @@ flake-utils.follows = "flake-utils"; }; }; - flake-utils.url = "github:numtide/flake-utils"; + flake-utils = { + url = "github:numtide/flake-utils"; + inputs.systems.follows = "systems"; + }; home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; @@ -65,6 +78,7 @@ inputs.nixpkgs.follows = "nixpkgs"; }; nur.url = "github:nix-community/NUR"; + systems.url = "github:nix-systems/default"; tetris = { url = "github:chvp/tetris"; inputs = { @@ -83,7 +97,7 @@ }; }; - outputs = inputs@{ self, nixpkgs, accentor, accentor-api, accentor-web, agenix, devshell, emacs-overlay, flake-utils, home-manager, lanzaboote, nix-index-database, nixos-mailserver, nur, tetris, www-chvp-be }: + outputs = inputs@{ self, nixpkgs, accentor, accentor-api, accentor-web, agenix, darwin, devshell, emacs-overlay, flake-utils, home-manager, lanzaboote, nix-index-database, nixos-mailserver, nur, tetris, www-chvp-be, ... }: let patches = builtins.map (patch: ./patches + "/${patch}") (builtins.filter (x: x != ".keep") (builtins.attrNames (builtins.readDir ./patches))); # Avoid IFD if there are no patches @@ -151,18 +165,26 @@ lasting-integrity = nixosSystem "x86_64-linux" "lasting-integrity"; urithiru = nixosSystem "x86_64-linux" "urithiru"; }; + darwinConfigurations.thaylen-city = darwin.lib.darwinSystem { + system = "aarch64-darwin"; + modules = [ + ./machines/thaylen-city + home-manager.darwinModules.home-manager + ]; + }; lsShells = builtins.readDir ./shells; shellFiles = builtins.filter (name: lsShells.${name} == "regular") (builtins.attrNames lsShells); shellNames = builtins.map (filename: builtins.head (builtins.split "\\." filename)) shellFiles; systemAttrs = flake-utils.lib.eachDefaultSystem (system: let - pkgs = import (nixpkgsForSystem system) { inherit overlays system; }; - nameToValue = name: import (./shells + "/${name}.nix") { inherit pkgs inputs system; }; + pkgs = import (nixpkgsForSystem system) { inherit overlays system; config.permittedInsecurePackages = [ "imagemagick-6.9.13-10" ]; }; + lib = pkgs.lib; + nameToValue = name: import (./shells + "/${name}.nix") { inherit lib pkgs inputs system; }; in { devShells = builtins.listToAttrs (builtins.map (name: { inherit name; value = nameToValue name; }) shellNames); } ); in - systemAttrs // { inherit nixosConfigurations; }; + systemAttrs // { inherit nixosConfigurations darwinConfigurations; }; } diff --git a/machines/thaylen-city/default.nix b/machines/thaylen-city/default.nix new file mode 100644 index 00000000..5285f7d6 --- /dev/null +++ b/machines/thaylen-city/default.nix @@ -0,0 +1,108 @@ +{ pkgs, ... }: + +{ + homebrew = { + enable = true; + casks = [ + "docker" + "libreoffice" + "rubymine" + ]; + global.brewfile = true; + onActivation = { + autoUpdate = true; + cleanup = "zap"; + upgrade = true; + }; + }; + networking = { + computerName = "Thaylen City"; + hostName = "thaylen-city"; + }; + nix = { + extraOptions = '' + experimental-features = nix-command flakes + keep-outputs = true + keep-derivations = true + ''; + configureBuildUsers = true; + }; + programs = { + bash.enable = false; + zsh.enable = true; + }; + security.pam.enableSudoTouchIdAuth = true; + services.nix-daemon.enable = true; + users.users."charlotte.vanpetegem" = { + name = "charlotte.vanpetegem"; + home = "/Users/charlotte.vanpetegem"; + shell = pkgs.zsh; + }; + + home-manager.users."charlotte.vanpetegem" = { + programs = { + direnv = { + enable = true; + enableZshIntegration = true; + nix-direnv = { + enable = true; + }; + config = { + global = { + load_dotenv = true; + }; + }; + }; + zsh = { + enable = true; + autocd = true; + autosuggestion.enable = true; + dotDir = ".config/zsh"; + history = { + expireDuplicatesFirst = true; + path = "$HOME/.local/share/zsh/history"; + }; + oh-my-zsh = { + enable = true; + plugins = [ + "autojump" + "common-aliases" + "extract" + "history-substring-search" + "git" + "tmux" + ]; + theme = "robbyrussell"; + }; + sessionVariables = { DEFAULT_USER = "charlotte.vanpetegem"; }; + syntaxHighlighting.enable = true; + }; + git = { + enable = true; + extraConfig = { + branch.autosetuprebase = "always"; + github.user = "chvp"; + merge.conflictStyle = "diff3"; + pull.rebase = true; + rerere.enabled = true; + rebase.autoStash = true; + }; + ignores = [ + ".DS_Store" + ".data" + ".direnv" + ".envrc" + ".idea" + ".dir-locals.el" + ]; + userEmail = "charlotte.vanpetegem@silverfin.com"; + userName = "Charlotte Van Petegem"; + }; + }; + + home = { + packages = [ pkgs.nix-direnv pkgs.docker-compose pkgs.autojump pkgs.tmux pkgs.ripgrep ]; + stateVersion = "24.11"; + }; + }; +} diff --git a/shells/nixos-config.nix b/shells/nixos-config.nix index 2e3f583c..e9443136 100644 --- a/shells/nixos-config.nix +++ b/shells/nixos-config.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: pkgs.devshell.mkShell { +{ pkgs, inputs, system, ... }: pkgs.devshell.mkShell { name = "NixOS config"; commands = [ { @@ -17,6 +17,7 @@ packages = [ pkgs.agenix pkgs.nixos-rebuild + inputs.darwin.packages.${system}.default pkgs.nixpkgs-fmt ]; } diff --git a/shells/silverfin.nix b/shells/silverfin.nix new file mode 100644 index 00000000..b12c9e20 --- /dev/null +++ b/shells/silverfin.nix @@ -0,0 +1,45 @@ +{ lib, pkgs, inputs, ... }: +pkgs.devshell.mkShell { + name = "Silverfin"; + imports = [ "${inputs.devshell}/extra/language/ruby.nix" ]; + devshell.startup = { + "link-devshell-dir".text = '' + ln -sf $DEVSHELL_DIR $PRJ_DATA_DIR/devshell + ''; + }; + packages = with pkgs; [ + cmake + ghostscript + graphicsmagick + imagemagick6 + jq + kubectl + minikube + mupdf-headless + nodejs_18 + xsv + yarn + zlib + ]; + env = [ + { + name = "LIBRARY_PATH"; + eval = "$LD_LIBRARY_PATH"; + } + ]; + language.c.compiler = lib.mkForce pkgs.clang; + language.ruby = { + package = pkgs.ruby_3_2; + nativeDeps = with pkgs; [ + git + graphicsmagick + icu + imagemagick6 + openssl + postgresql + libffi + libyaml + zlib + ]; + }; +}