diff --git a/configuration.nix b/configuration.nix new file mode 100644 index 0000000..c4e2e96 --- /dev/null +++ b/configuration.nix @@ -0,0 +1,86 @@ +{ config, pkgs, pkgs-unstable, agenix, ... }: + +{ + # imports = [ ]; + + # List packages installed in system profile. To search by name, run: + # $ nix-env -qaP | grep wget + environment.systemPackages = with pkgs; [ + vim + agenix.packages.aarch64-darwin.default + iterm2 + tailscale + ]; + + # Use a custom configuration.nix location. + # $ darwin-rebuild switch -I darwin-config=$HOME/.config/nixpkgs/darwin/configuration.nix + environment.darwinConfig = "$HOME/.config/home-manager/configuration.nix"; + + # Auto upgrade nix package and the daemon service. + services.nix-daemon.enable = true; + #services.nix-daemon.tempDir = "/nix/tmp"; + nix.package = pkgs.nix; + + # Create /etc/zshrc that loads the nix-darwin environment. + programs.zsh.enable = true; # default shell on catalina + # programs.fish.enable = true; + + # Used for backwards compatibility, please read the changelog before changing. + # $ darwin-rebuild changelog + system.stateVersion = 4; + system.keyboard.enableKeyMapping = true; + + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + nixpkgs.hostPlatform = "aarch64-darwin"; + + users.users.millironx = { + name = "millironx"; + home = "/Users/millironx"; + }; + + homebrew = { + enable = true; + onActivation = { + autoUpdate = true; + cleanup = "zap"; + upgrade = true; + }; + caskArgs = { + no_quarantine = true; + + }; + brews = [ "borgbackup/tap/borgbackup-fuse" "firefoxpwa" "r" ]; + casks = [ + "alex313031-thorium" + "alt-tab" + "anki" + "element" + "firefox" + "freetube" + "inkscape" + "logseq" + "macfuse" + "musescore" + "nextcloud" + "obs" + "openrct2" + "qownnotes" + "rancher" + "rstudio" + "signal" + "steam" + "textmate" + "thunderbird@esr" + "veracrypt" + "vlc" + "vorta" + "zed" + "zotero" + ]; + masApps = { + "Bitwarden" = 1352778147; + "Tailscale" = 1475387142; + }; + }; + +} diff --git a/flake.lock b/flake.lock index f4ab185..00ed064 100644 --- a/flake.lock +++ b/flake.lock @@ -87,18 +87,39 @@ "type": "github" } }, + "nix-darwin": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1736820923, + "narHash": "sha256-SDuKLOWAh8VJRXlNWQn9QE99bjeEUAAbYXqrKGbsiyk=", + "owner": "LnL7", + "repo": "nix-darwin", + "rev": "944c2b181792ae7ae6b20c0df3f44879c11706c9", + "type": "github" + }, + "original": { + "owner": "LnL7", + "ref": "nix-darwin-24.11", + "repo": "nix-darwin", + "type": "github" + } + }, "nixpkgs": { "locked": { - "lastModified": 1734083684, - "narHash": "sha256-5fNndbndxSx5d+C/D0p/VF32xDiJCJzyOqorOYW4JEo=", + "lastModified": 1736949135, + "narHash": "sha256-HGSacCG66FNt/oQjxXsp+2og657hZFjBDAhUGzPoyn4=", "owner": "nixos", "repo": "nixpkgs", - "rev": "314e12ba369ccdb9b352a4db26ff419f7c49fa84", + "rev": "5a141918f8b3ea128746881b6c099a6df569a51e", "type": "github" }, "original": { "owner": "nixos", - "ref": "nixos-24.11", + "ref": "nixpkgs-24.11-darwin", "repo": "nixpkgs", "type": "github" } @@ -123,6 +144,7 @@ "inputs": { "agenix": "agenix", "home-manager": "home-manager_2", + "nix-darwin": "nix-darwin", "nixpkgs": "nixpkgs", "nixpkgs-unstable": "nixpkgs-unstable" } diff --git a/flake.nix b/flake.nix index 00351da..8331b89 100644 --- a/flake.nix +++ b/flake.nix @@ -3,7 +3,7 @@ inputs = { # Specify the source of Home Manager and Nixpkgs. - nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11"; + nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-24.11-darwin"; nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable"; home-manager = { url = "github:nix-community/home-manager/release-24.11"; @@ -13,9 +13,14 @@ url = "github:ryantm/agenix"; inputs.nixpkgs.follows = "nixpkgs"; }; + nix-darwin = { + url = "github:LnL7/nix-darwin/nix-darwin-24.11"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; - outputs = { nixpkgs, nixpkgs-unstable, home-manager, agenix, ... }: + outputs = + { self, nix-darwin, nixpkgs, nixpkgs-unstable, home-manager, agenix, ... }: let system = "aarch64-darwin"; pkgs = import nixpkgs { @@ -39,5 +44,14 @@ # to pass through arguments to home.nix extraSpecialArgs = { inherit pkgs-unstable; }; }; + + darwinConfigurations."corianne" = nix-darwin.lib.darwinSystem rec { + inherit system; + specialArgs = { + pkgs-unstable = import nixpkgs-unstable { inherit system; }; + agenix = agenix; + }; + modules = [ ./configuration.nix agenix.darwinModules.default ]; + }; }; } diff --git a/home.nix b/home.nix index 6d6136e..321b2a3 100644 --- a/home.nix +++ b/home.nix @@ -19,7 +19,6 @@ # environment. home.packages = with pkgs; [ act - anki-bin # anki is broken on aarch64-darwin asitop bat cowsay @@ -35,15 +34,10 @@ gnupg gnused htop - inkscape-with-extensions jq - lapce - logseq lsd lynx most - musescore - neovide nil nixd nixfmt @@ -53,14 +47,11 @@ python3 quarto shellcheck - pkgs-unstable.signal-desktop sketchybar-app-font sqlitebrowser texlive.combined.scheme-full pkgs-unstable.woodpecker-cli yt-dlp - pkgs-unstable.zed-editor - zotero zulu17 # # It is sometimes useful to fine-tune packages, for example, by applying @@ -84,6 +75,9 @@ (pkgs.writeShellScriptBin "uq" '' xattr -rdv com.apple.quarantine "/Applications/$1.app" '') + (pkgs.writeShellScriptBin "get-current-wifi" '' + ipconfig getsummary $(networksetup -listallhardwareports | awk '/Hardware Port: Wi-Fi/{getline; print $2}') | awk -F ' SSID : ' '/ SSID : / {print $2}' + '') ]; # Home Manager is pretty good at managing dotfiles. The primary way to manage