at main 3.2 kB view raw
1{ 2 description = "nix-darwin system flake"; 3 4 inputs = { 5 nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-25.05-darwin"; 6 nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; 7 8 nix-darwin.url = "github:nix-darwin/nix-darwin/nix-darwin-25.05"; 9 nix-darwin.inputs.nixpkgs.follows = "nixpkgs"; 10 }; 11 12 outputs = inputs@{ 13 self, 14 nix-darwin, 15 nixpkgs, 16 nixpkgs-unstable 17 }: 18 let 19 system = "aarch64-darwin"; 20 pkgs = import nixpkgs { 21 inherit system; 22 config.allowUnfree = true; 23 overlays = [ 24 (import ./overlays/jpm.nix) 25 (import ./overlays/bleve.nix) 26 (final: prev: { 27 kotlin-lsp = final.callPackage ./overlays/kotlin-lsp.nix {}; 28 }) 29 ]; 30 }; 31 pkgs-unstable = nixpkgs-unstable.legacyPackages.${system}; 32 in 33 { 34 # Build darwin flake using: 35 # $ darwin-rebuild build --flake ~/.config/nix 36 # $ darwin-rebuild switch --flake ~/.config/nix 37 darwinConfigurations."boltless-MacBook-Air" = nix-darwin.lib.darwinSystem { 38 modules = [ 39 ./darwin.nix 40 ]; 41 specialArgs = { 42 inherit self pkgs-unstable; 43 }; 44 }; 45 darwinConfigurations."boltless-Studio" = nix-darwin.lib.darwinSystem { 46 modules = [ 47 ./darwin.nix 48 ]; 49 specialArgs = { 50 inherit self pkgs-unstable; 51 }; 52 }; 53 # based on https://zaynetro.com/post/2024-you-dont-need-home-manager-nix 54 # $ nix profile install . 55 # $ nix profile upgrade nix 56 packages.${system}.default = pkgs.buildEnv { 57 name = "my-env"; 58 paths = [ 59 pkgs.bacon 60 pkgs.bleve-cli 61 pkgs.btop 62 pkgs.difftastic 63 pkgs.direnv 64 pkgs.dust 65 pkgs.eza 66 pkgs.fd 67 pkgs.fzf 68 pkgs.gh 69 pkgs.git 70 pkgs.go 71 pkgs.gopls 72 pkgs.hello 73 pkgs.janet 74 pkgs.yarn 75 pkgs.jpm 76 pkgs.kotlin-lsp 77 pkgs.ktfmt 78 pkgs.meld 79 pkgs.mprocs 80 pkgs.nil 81 pkgs.nixfmt-classic 82 pkgs.nodejs_24 83 pkgs.pandoc 84 pkgs.qmk 85 pkgs.ripgrep 86 pkgs.stack 87 pkgs.sumneko-lua-language-server 88 pkgs.tmux 89 pkgs.tree 90 pkgs.typescript-language-server 91 pkgs.typst 92 pkgs.unixtools.watch 93 pkgs.vim 94 pkgs.zellij 95 pkgs-unstable.jujutsu 96 pkgs-unstable.neovim 97 (pkgs-unstable.lua5_1.withPackages (ps: with ps; [luarocks])) 98 (pkgs.buildEnv { 99 name = "mailing"; 100 paths = [ 101 pkgs.neomutt 102 # pkgs.mutt-wizard 103 # pkgs.isync 104 # pkgs.msmtp 105 # pkgs.pass 106 # pkgs.cacert 107 # pkgs.gettext 108 ]; 109 }) 110 ] ++ (if pkgs.stdenv.isDarwin then [ 111 # TODO: automate this with nix: 112 # $ ln -sfn ~/.nix-profile/Applications ~/Applications/Nix\ User\ Apps 113 pkgs.anki-bin 114 pkgs.brave 115 pkgs.iina 116 pkgs.macmon 117 pkgs.docker 118 pkgs.slack 119 ] else []); 120 }; 121 # This can be just `imports = [ ./templates/templates.nix ]` when using flake-parts 122 templates = ((import ./templates/templates.nix) { inherit inputs; }).flake.templates; 123 }; 124} 125# vim: et:ts=2