commit dc4fe16f126e99d6c03f2126a157eaeb0e3dd17a Author: Andrei Lazarescu Date: Fri May 30 23:38:25 2025 +0300 Initial commit diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..b32e564 --- /dev/null +++ b/flake.lock @@ -0,0 +1,136 @@ +{ + "nodes": { + "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "nur", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1733312601, + "narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1748489961, + "narHash": "sha256-uGnudxMoQi2c8rpPoHXuQSm80NBqlOiNF4xdT3hhzLM=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "95c988cf08e9a5a8fe7cc275d5e3f24e9e87bd51", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "master", + "repo": "home-manager", + "type": "github" + } + }, + "nix-darwin": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1748352827, + "narHash": "sha256-sNUUP6qxGkK9hXgJ+p362dtWLgnIWwOCmiq72LAWtYo=", + "owner": "nix-darwin", + "repo": "nix-darwin", + "rev": "44a7d0e687a87b73facfe94fba78d323a6686a90", + "type": "github" + }, + "original": { + "owner": "nix-darwin", + "ref": "master", + "repo": "nix-darwin", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1748406211, + "narHash": "sha256-B3BsCRbc+x/d0WiG1f+qfSLUy+oiIfih54kalWBi+/M=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "3d1f29646e4b57ed468d60f9d286cde23a8d1707", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nur": { + "inputs": { + "flake-parts": "flake-parts", + "nixpkgs": [ + "nixpkgs" + ], + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1748508910, + "narHash": "sha256-KIe/4Vum4kUvj8BP5cNhc3yUdfyU1ajS/tKSxstVgZw=", + "owner": "nix-community", + "repo": "NUR", + "rev": "624ce0fd6d30a2e9ed2bf8da7daab2b0a84ffa76", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "NUR", + "type": "github" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "nix-darwin": "nix-darwin", + "nixpkgs": "nixpkgs", + "nur": "nur" + } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "nur", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1733222881, + "narHash": "sha256-JIPcz1PrpXUCbaccEnrcUS8jjEb/1vJbZz5KkobyFdM=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "49717b5af6f80172275d47a418c9719a31a78b53", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..18b9498 --- /dev/null +++ b/flake.nix @@ -0,0 +1,209 @@ +{ + description = "Example nix-darwin system flake"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + nix-darwin.url = "github:nix-darwin/nix-darwin/master"; + nix-darwin.inputs.nixpkgs.follows = "nixpkgs"; + home-manager.url = "github:nix-community/home-manager/master"; + home-manager.inputs.nixpkgs.follows = "nixpkgs"; + nur.url = "github:nix-community/NUR"; + nur.inputs.nixpkgs.follows = "nixpkgs"; + }; + + outputs = { self, nix-darwin, nixpkgs, home-manager, nur, ... }: + let + configuration = { pkgs, nur, ... }: { + + nixpkgs.overlays = [ nur.overlays.default ]; + # List packages installed in system profile. To search by name, run: + # $ nix-env -qaP | grep wget + environment.systemPackages = []; + + # Necessary for using flakes on this system. + nix.settings.experimental-features = "nix-command flakes"; + + # Enable alternative shell support in nix-darwin. + # programs.fish.enable = true; + + # Set Git commit hash for darwin-version. + system.configurationRevision = self.rev or self.dirtyRev or null; + + # Used for backwards compatibility, please read the changelog before changing. + # $ darwin-rebuild changelog + system.stateVersion = 5; + + # The platform the configuration will be used on. + nixpkgs.hostPlatform = "aarch64-darwin"; + nixpkgs.config = { allowUnfree = true; }; + + users.users.andrei = { + home = "/Users/andrei"; + name = "andrei"; + }; + + system.primaryUser = "andrei"; + system.defaults.dock = { + tilesize = 40; + show-recents = false; + persistent-apps = [ + ]; + }; + + system.defaults.finder = { + FXDefaultSearchScope = "SCcf"; + FXEnableExtensionChangeWarning = false; + FXRemoveOldTrashItems = true; + }; + + system.defaults.NSGlobalDomain = { + NSAutomaticCapitalizationEnabled = false; + NSAutomaticSpellingCorrectionEnabled = false; + "com.apple.mouse.tapBehavior" = 1; + }; + + fonts.packages = [ pkgs.fira-code pkgs.nerd-fonts.fira-code ]; + + homebrew = { + enable = true; + brews = []; + casks = [ "raycast" "firefox" "slack" ]; + onActivation = { + cleanup = "zap"; + }; + global = { + autoUpdate = false; + }; + }; + + programs = { + _1password-gui.enable = true; + }; + + security.pam.services.sudo_local = { + enable = true; + reattach = true; + touchIdAuth = true; + watchIdAuth = true; + }; + + + services = { + tailscale = { + enable = true; + }; + }; + + home-manager.useGlobalPkgs = true; + home-manager.backupFileExtension = "bak"; + home-manager.users.andrei = { + home.packages = []; + home.stateVersion = "25.11"; + + programs = { + kitty = { + enable = true; + font = { + name = "FiraCode Nerd Font Mono"; + size = 16; + }; + settings = { + disable_ligatures = "never"; + confirm_os_window_close = 0; + }; + shellIntegration.enableZshIntegration = true; + keybindings = { + "cmd+u" = "kitten hints --type url"; + }; + }; + firefox = { + enable = true; + package = null; + profiles.default = { + isDefault = true; + extensions = { + force = true; + packages = with pkgs.nur.repos.rycee.firefox-addons; [ + ublock-origin + onepassword-password-manager + ]; + settings = {}; + }; + settings = { + "extensions.autoDisableScopes" = 0; + "full-screen-api.transition-duration.enter" = 0; + "full-screen-api.transition-duration.exit" = 0; + "full-screen-api.warning.timeout" = 0; + "browser.fullscreen.exit_on_escape" = false; + "browser.tabs.closeWindowWithLastTab" = false; + "browser.ctrlTab.recentlyUsedOrder" = true; + "browser.startup.page" = 3; + }; + }; + }; + vscode = { + enable = true; + mutableExtensionsDir = false; + profiles.default = { + enableExtensionUpdateCheck = true; + enableUpdateCheck = true; + extensions = [ + pkgs.vscode-extensions.ms-vscode-remote.remote-ssh + pkgs.vscode-extensions.ms-vscode-remote.remote-ssh-edit + pkgs.vscode-extensions.jnoortheen.nix-ide + ]; + userSettings = { + "editor.fontSize" = 16; + "editor.fontFamily" = "'FiraCode Nerd Font Mono'"; + "editor.fontLigatures" = true; + "security.workspace.trust.enabled" = false; + "remote.SSH.enableAgentForwarding" = true; + }; + }; + }; + ssh = { + enable = true; + extraConfig = '' + Host * + IdentityAgent "~/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock" + SetEnv TERM=xterm-256color + ''; + }; + direnv = { + enable = true; + enableZshIntegration = true; + nix-direnv.enable = true; + #silent = true; + }; + zsh = { + enable = true; + enableCompletion = true; + enableVteIntegration = true; + autocd = true; + autosuggestion = { + enable = true; + }; + syntaxHighlighting = { + enable = true; + }; + }; + }; + + services = { + ollama = { + enable = true; + # loadModels = [ "llama3.2:3b" "deepseek-r1:1.5b" "devstral:24b" "gemma3:12b" "gemma3:1b" ]; + }; + }; + }; + }; + in + { + # Build darwin flake using: + # $ darwin-rebuild build --flake .#Andreis-MacBook-Pro + darwinConfigurations."Andreis-MacBook-Pro" = nix-darwin.lib.darwinSystem { + specialArgs = { inherit nur; }; + modules = [ configuration home-manager.darwinModules.home-manager ]; + }; + }; +}