diff --git a/flake.lock b/flake.lock index df7b62b..585966f 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,22 @@ { "nodes": { + "brew-src": { + "flake": false, + "locked": { + "lastModified": 1769363988, + "narHash": "sha256-BiGPeulrDVetXP+tjxhMcGLUROZAtZIhU5m4MqawCfM=", + "owner": "Homebrew", + "repo": "brew", + "rev": "d01011cac6d72032c75fd2cd9489909e95d9faf2", + "type": "github" + }, + "original": { + "owner": "Homebrew", + "ref": "5.0.12", + "repo": "brew", + "type": "github" + } + }, "flake-parts": { "inputs": { "nixpkgs-lib": "nixpkgs-lib" @@ -39,6 +56,38 @@ "type": "github" } }, + "homebrew-cask": { + "flake": false, + "locked": { + "lastModified": 1770811300, + "narHash": "sha256-sSxLj4so0NJYjin13DJqEnZbKyYF5XYblnjDiv1eyfc=", + "owner": "homebrew", + "repo": "homebrew-cask", + "rev": "29406a41146145e7e32c4a5ff4c6c1471c2eda56", + "type": "github" + }, + "original": { + "owner": "homebrew", + "repo": "homebrew-cask", + "type": "github" + } + }, + "homebrew-core": { + "flake": false, + "locked": { + "lastModified": 1770811629, + "narHash": "sha256-qzjYPCYuRo+dbVJArHRbC030OwO5iilVlCG2A02CtrA=", + "owner": "homebrew", + "repo": "homebrew-core", + "rev": "779ff21375317500a9b0089e2fcbb1802abae658", + "type": "github" + }, + "original": { + "owner": "homebrew", + "repo": "homebrew-core", + "type": "github" + } + }, "import-tree": { "locked": { "lastModified": 1763762820, @@ -54,6 +103,45 @@ "type": "github" } }, + "nix-darwin": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1770736414, + "narHash": "sha256-x5xdJgUxNflO9j2sJHIHnPujDy6eAWJPCMQml5y9XB4=", + "owner": "nix-darwin", + "repo": "nix-darwin", + "rev": "7c952d9a524ffbbd5b5edca38fe6d943499585cc", + "type": "github" + }, + "original": { + "owner": "nix-darwin", + "ref": "master", + "repo": "nix-darwin", + "type": "github" + } + }, + "nix-homebrew": { + "inputs": { + "brew-src": "brew-src" + }, + "locked": { + "lastModified": 1769437432, + "narHash": "sha256-8d7KnCpT2LweRvSzZYEGd9IM3eFX+A78opcnDM0+ndk=", + "owner": "zhaofengli", + "repo": "nix-homebrew", + "rev": "a5409abd0d5013d79775d3419bcac10eacb9d8c5", + "type": "github" + }, + "original": { + "owner": "zhaofengli", + "repo": "nix-homebrew", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1769089682, @@ -105,7 +193,11 @@ "inputs": { "flake-parts": "flake-parts", "home-manager": "home-manager", + "homebrew-cask": "homebrew-cask", + "homebrew-core": "homebrew-core", "import-tree": "import-tree", + "nix-darwin": "nix-darwin", + "nix-homebrew": "nix-homebrew", "nixpkgs": "nixpkgs", "nixpkgs-unstable": "nixpkgs-unstable" } diff --git a/flake.nix b/flake.nix index 6c6e2b4..10ae7bf 100755 --- a/flake.nix +++ b/flake.nix @@ -9,36 +9,98 @@ nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11"; nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; + # Nix Darwin + nix-darwin.url = "github:nix-darwin/nix-darwin/master"; + nix-darwin.inputs.nixpkgs.follows = "nixpkgs"; + # Home manager home-manager.url = "github:nix-community/home-manager/release-25.11"; home-manager.inputs.nixpkgs.follows = "nixpkgs"; + + # Nix Homebrew + nix-homebrew.url = "github:zhaofengli/nix-homebrew"; + homebrew-core = { + url = "github:homebrew/homebrew-core"; + flake = false; + }; + homebrew-cask = { + url = "github:homebrew/homebrew-cask"; + flake = false; + }; }; outputs = inputs@{ + self, nixpkgs, + nix-darwin, flake-parts, import-tree, home-manager, + nix-homebrew, + homebrew-core, + homebrew-cask, nixpkgs-unstable, ... }: flake-parts.lib.mkFlake { inherit inputs; } ( { ... }: { - systems = [ "x86_64-linux" ]; + systems = [ + "x86_64-linux" + "aarch64-darwin" + ]; flake = { nixosConfigurations = { nixos = nixpkgs.lib.nixosSystem { + specialArgs = { + import-tree = import-tree; + home-manager = home-manager; + }; modules = [ - (import-tree ./modules/system) - ./modules/hardware-configuration.nix - (import ./modules/overlays.nix { inherit nixpkgs nixpkgs-unstable; }) + (import-tree ./hosts/common) + (import ./hosts/nixos/overlays.nix { inherit nixpkgs nixpkgs-unstable; }) + + (import-tree ./modules/system/common) + (import-tree ./modules/system/nixos) + (import-tree ./hosts/nixos/system) ] ++ [ + (import-tree ./hosts/common) home-manager.nixosModules.home-manager - (import ./modules/overlays.nix { inherit nixpkgs nixpkgs-unstable; }) - (import ./modules/users/home.nix { inherit import-tree home-manager; }) + (import /hosts/nixos/overlays.nix { inherit nixpkgs nixpkgs-unstable; }) + + (import-tree ./modules/home/common) + (import-tree ./modules/home/nixos) + (import-tree ./hosts/darwin/home) + ]; + }; + }; + darwinConfigurations = { + "MacBook-Air-de-Laurent" = nix-darwin.lib.darwinSystem { + specialArgs = { + self = self; + import-tree = import-tree; + home-manager = home-manager; + homebrew-core = homebrew-core; + homebrew-cask = homebrew-cask; + }; + modules = [ + (import-tree ./hosts/common) + nix-homebrew.darwinModules.nix-homebrew + (import ./hosts/nixos/overlays.nix { inherit nixpkgs nixpkgs-unstable; }) + + (import-tree ./modules/system/common) + (import-tree ./hosts/darwin/system) + ] + ++ [ + (import-tree ./hosts/common) + home-manager.darwinModules.home-manager + (import /hosts/nixos/overlays.nix { inherit nixpkgs nixpkgs-unstable; }) + + (import-tree ./modules/home/common) + (import-tree ./modules/home/darwin) + (import-tree ./hosts/darwin/home) ]; }; }; diff --git a/hosts/common/home-manager.nix b/hosts/common/home-manager.nix new file mode 100644 index 0000000..1834694 --- /dev/null +++ b/hosts/common/home-manager.nix @@ -0,0 +1,7 @@ +{ ... }: +{ + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.overwriteBackup = true; + home-manager.backupFileExtension = "bak"; +} diff --git a/hosts/common/nix.nix b/hosts/common/nix.nix new file mode 100644 index 0000000..19b8aba --- /dev/null +++ b/hosts/common/nix.nix @@ -0,0 +1,15 @@ +{ ... }: +{ + system.primaryUser = "alistreaza"; + + nix = { + settings = { + experimental-features = "nix-command flakes"; + trusted-users = [ + # Needed by Devenv + "root" + "alistreaza" + ]; + }; + }; +} diff --git a/hosts/darwin/home/alistreaza.nix b/hosts/darwin/home/alistreaza.nix new file mode 100644 index 0000000..0697619 --- /dev/null +++ b/hosts/darwin/home/alistreaza.nix @@ -0,0 +1,34 @@ +{ ... }: +{ + home-manager.users.alistreaza = { + + home = { + username = "alistreaza"; + homeDirectory = /Users/alistreaza; + }; + + # No Home Application Folders + targets.darwin.linkApps.enable = false; + targets.darwin.copyApps.enable = false; + + # Apps + home.shell.zsh = true; + home.shell.git = true; + + # Homebrew apps + home.homebrew.iterm = true; + home.homebrew.zed = true; + home.homebrew.jetbrain = true; + + home.homebrew.iina = true; + home.homebrew.zen = true; + home.homebrew.obsidian = true; + home.homebrew.microsoft = true; + + home.homebrew.keka = true; + + # The state version is required and should stay at the version you + # originally installed. + home.stateVersion = "25.11"; + }; +} diff --git a/hosts/darwin/system/os.nix b/hosts/darwin/system/os.nix new file mode 100644 index 0000000..fe96b63 --- /dev/null +++ b/hosts/darwin/system/os.nix @@ -0,0 +1,9 @@ +{ import-tree, ... }: +{ + imports = [ + ./partials/users.nix + (import-tree ./apps) + ]; + + nixpkgs.hostPlatform = "aarch64-darwin"; +} diff --git a/hosts/darwin/system/partials/homebrew.nix b/hosts/darwin/system/partials/homebrew.nix new file mode 100644 index 0000000..9b42547 --- /dev/null +++ b/hosts/darwin/system/partials/homebrew.nix @@ -0,0 +1,5 @@ +{ config, ... }: +{ + homebrew.enable = true; + homebrew.taps = builtins.attrNames config.nix-homebrew.taps; +} diff --git a/hosts/darwin/system/partials/nix-homebrew.nix b/hosts/darwin/system/partials/nix-homebrew.nix new file mode 100644 index 0000000..17446a1 --- /dev/null +++ b/hosts/darwin/system/partials/nix-homebrew.nix @@ -0,0 +1,28 @@ +{ + homebrew-core, + homebrew-cask, + ... +}: +{ + nix-homebrew = { + # User owning the Homebrew prefix + user = "alistreaza"; + + # Install Homebrew under the default prefix + enable = true; + + # Apple Silicon Only: Also install Homebrew under the default Intel prefix for Rosetta 2 + enableRosetta = false; + + # Optional: Declarative tap management + taps = { + "homebrew/homebrew-core" = homebrew-core; + "homebrew/homebrew-cask" = homebrew-cask; + }; + + # Optional: Enable fully-declarative tap management + # + # With mutableTaps disabled, taps can no longer be added imperatively with `brew tap`. + mutableTaps = false; + }; +} diff --git a/hosts/darwin/system/partials/system.nix b/hosts/darwin/system/partials/system.nix new file mode 100644 index 0000000..13724cc --- /dev/null +++ b/hosts/darwin/system/partials/system.nix @@ -0,0 +1,30 @@ +{ self, ... }: +{ + # Add ability to use TouchID for sudo + security.pam.services.sudo_local.touchIdAuth = true; + + system = { + stateVersion = 6; + configurationRevision = self.rev or self.dirtyRev or null; + defaults = { + controlcenter.BatteryShowPercentage = true; + dock = { + show-recents = false; + tilesize = 30; + autohide = false; + orientation = "bottom"; + }; + finder = { + ShowHardDrivesOnDesktop = false; + ShowMountedServersOnDesktop = false; + ShowExternalHardDrivesOnDesktop = false; + ShowRemovableMediaOnDesktop = false; + FXRemoveOldTrashItems = true; + NewWindowTarget = "Home"; + }; + loginwindow = { + GuestEnabled = false; + }; + }; + }; +} diff --git a/hosts/darwin/system/partials/users.nix b/hosts/darwin/system/partials/users.nix new file mode 100644 index 0000000..0fbf2ec --- /dev/null +++ b/hosts/darwin/system/partials/users.nix @@ -0,0 +1,8 @@ +{ ... }: +{ + users.users = { + alistreaza = { + home = /Users/alistreaza; + }; + }; +} diff --git a/modules/users/partials/firefox.nix b/hosts/nixos/home/partials/firefox.nix similarity index 100% rename from modules/users/partials/firefox.nix rename to hosts/nixos/home/partials/firefox.nix diff --git a/modules/users/partials/ghostty.nix b/hosts/nixos/home/partials/ghostty.nix similarity index 100% rename from modules/users/partials/ghostty.nix rename to hosts/nixos/home/partials/ghostty.nix diff --git a/modules/users/partials/gnome/dconf.nix b/hosts/nixos/home/partials/gnome/dconf.nix similarity index 100% rename from modules/users/partials/gnome/dconf.nix rename to hosts/nixos/home/partials/gnome/dconf.nix diff --git a/modules/users/partials/gnome/wallpapers/dark-gray.svg b/hosts/nixos/home/partials/gnome/wallpapers/dark-gray.svg similarity index 100% rename from modules/users/partials/gnome/wallpapers/dark-gray.svg rename to hosts/nixos/home/partials/gnome/wallpapers/dark-gray.svg diff --git a/modules/users/partials/gnome/wallpapers/frappe.svg b/hosts/nixos/home/partials/gnome/wallpapers/frappe.svg similarity index 100% rename from modules/users/partials/gnome/wallpapers/frappe.svg rename to hosts/nixos/home/partials/gnome/wallpapers/frappe.svg diff --git a/modules/users/partials/gnome/wallpapers/latte.svg b/hosts/nixos/home/partials/gnome/wallpapers/latte.svg similarity index 100% rename from modules/users/partials/gnome/wallpapers/latte.svg rename to hosts/nixos/home/partials/gnome/wallpapers/latte.svg diff --git a/modules/users/partials/gnome/wallpapers/macchiato.svg b/hosts/nixos/home/partials/gnome/wallpapers/macchiato.svg similarity index 100% rename from modules/users/partials/gnome/wallpapers/macchiato.svg rename to hosts/nixos/home/partials/gnome/wallpapers/macchiato.svg diff --git a/modules/users/partials/gnome/wallpapers/mocha.svg b/hosts/nixos/home/partials/gnome/wallpapers/mocha.svg similarity index 100% rename from modules/users/partials/gnome/wallpapers/mocha.svg rename to hosts/nixos/home/partials/gnome/wallpapers/mocha.svg diff --git a/modules/users/partials/gnome/wallpapers/solarized-light.svg b/hosts/nixos/home/partials/gnome/wallpapers/solarized-light.svg similarity index 100% rename from modules/users/partials/gnome/wallpapers/solarized-light.svg rename to hosts/nixos/home/partials/gnome/wallpapers/solarized-light.svg diff --git a/modules/users/partials/gnome/wallpapers/solarized.svg b/hosts/nixos/home/partials/gnome/wallpapers/solarized.svg similarity index 100% rename from modules/users/partials/gnome/wallpapers/solarized.svg rename to hosts/nixos/home/partials/gnome/wallpapers/solarized.svg diff --git a/modules/users/partials/xdg.nix b/hosts/nixos/home/partials/xdg.nix similarity index 100% rename from modules/users/partials/xdg.nix rename to hosts/nixos/home/partials/xdg.nix diff --git a/hosts/nixos/home/users/alistreaza.nix b/hosts/nixos/home/users/alistreaza.nix new file mode 100644 index 0000000..0f1059b --- /dev/null +++ b/hosts/nixos/home/users/alistreaza.nix @@ -0,0 +1,36 @@ +{ import-tree, ... }: +{ + home-manager.users.alistreaza = { + + imports = [ + (import-tree ./options) + (import-tree ./partials) + ]; + + home = { + username = "alistreaza"; + homeDirectory = "/home/alistreaza"; + }; + + home.shell.zsh = true; + home.shell.git = true; + + # Code editor + home.ide.zed.enable = true; + + # IDE Jetbrains + home.ide.jetbrains.idea.enable = false; + home.ide.jetbrains.pycharm.enable = false; + home.ide.jetbrains.phpstorm.enable = false; + home.ide.jetbrains.rustrover.enable = false; + + # IDE Data Jetbrains + home.ide.jetbrains.datagrip.enable = false; + home.ide.jetbrains.dataspell.enable = false; + + # Markdown Editor + home.editor.obsidian.enable = false; + + home.stateVersion = "25.11"; + }; +} diff --git a/modules/overlays.nix b/hosts/nixos/overlays.nix similarity index 100% rename from modules/overlays.nix rename to hosts/nixos/overlays.nix diff --git a/modules/hardware-configuration.nix b/hosts/nixos/system/hardware-configuration.nix similarity index 100% rename from modules/hardware-configuration.nix rename to hosts/nixos/system/hardware-configuration.nix diff --git a/modules/system/os.nix b/hosts/nixos/system/os.nix similarity index 92% rename from modules/system/os.nix rename to hosts/nixos/system/os.nix index 7e8212a..f9fde28 100755 --- a/modules/system/os.nix +++ b/hosts/nixos/system/os.nix @@ -1,8 +1,6 @@ { ... }: { - nix.settings.experimental-features = "nix-command flakes"; - # System services os.boot.systemd.enable = true; os.boot.plymouth.enable = true; @@ -37,6 +35,9 @@ os.shell.dev.enable = true; os.shell.devenv.enable = true; + # Ssh + programs.ssh.enableAskPassword = false; # No-window git push fix + # System version system.stateVersion = "25.11"; } diff --git a/modules/system/partials/kernel.nix b/hosts/nixos/system/partials/kernel.nix similarity index 100% rename from modules/system/partials/kernel.nix rename to hosts/nixos/system/partials/kernel.nix diff --git a/modules/system/partials/networking.nix b/hosts/nixos/system/partials/networking.nix similarity index 100% rename from modules/system/partials/networking.nix rename to hosts/nixos/system/partials/networking.nix diff --git a/modules/system/partials/users.nix b/hosts/nixos/system/partials/users.nix similarity index 63% rename from modules/system/partials/users.nix rename to hosts/nixos/system/partials/users.nix index 9e9c5ac..5e2b378 100644 --- a/modules/system/partials/users.nix +++ b/hosts/nixos/system/partials/users.nix @@ -1,12 +1,6 @@ { ... }: { - nix.settings.trusted-users = [ - # Needed by Devenv - "root" - "alistreaza" - ]; - users.users = { alistreaza = { isNormalUser = true; diff --git a/modules/home/common/git.nix b/modules/home/common/git.nix new file mode 100644 index 0000000..4bb8ab6 --- /dev/null +++ b/modules/home/common/git.nix @@ -0,0 +1,28 @@ +{ + lib, + config, + ... +}: +with lib; +let + cfg = config.home.shell.git; +in +{ + options.home.shell.git = { + enable = mkEnableOption "Zen Editor options"; + }; + config = mkIf cfg.enable { + + programs.git = { + enable = true; + config.init.defaultBranch = "main"; + settings = { + user = { + name = "Laurent Gueret"; + email = "gueretlob@pm.me"; + }; + }; + }; + + }; +} diff --git a/modules/system/options/apps/sh/zsh.nix b/modules/home/common/zsh.nix similarity index 59% rename from modules/system/options/apps/sh/zsh.nix rename to modules/home/common/zsh.nix index 25081ab..170276e 100644 --- a/modules/system/options/apps/sh/zsh.nix +++ b/modules/home/common/zsh.nix @@ -1,10 +1,10 @@ { lib, config, ... }: with lib; let - cfg = config.os.shell.zsh; + cfg = config.home.shell.zsh; in { - options.os.shell.zsh = { + options.home.shell.zsh = { enable = mkEnableOption "System zsh service"; }; config = mkIf cfg.enable { @@ -12,13 +12,12 @@ in programs.zsh = { enable = true; enableCompletion = true; - autosuggestions.enable = true; + autosuggestion.enable = true; syntaxHighlighting.enable = true; - }; - - programs.neovim = { - enable = true; - defaultEditor = true; + oh-my-zsh = { + enable = true; + theme = "af-magic"; + }; }; }; diff --git a/modules/home/darwin/iina.nix b/modules/home/darwin/iina.nix new file mode 100644 index 0000000..869a889 --- /dev/null +++ b/modules/home/darwin/iina.nix @@ -0,0 +1,17 @@ +{ lib, config, ... }: +with lib; +let + cfg = config.home.homebrew.iina; +in +{ + options.home.homebrew.iina = { + enable = mkEnableOption "System iina homebrew service"; + }; + config = mkIf cfg.enable { + + homebrew.casks = [ + "iina" + ]; + + }; +} diff --git a/modules/home/darwin/iterm.nix b/modules/home/darwin/iterm.nix new file mode 100644 index 0000000..384f67b --- /dev/null +++ b/modules/home/darwin/iterm.nix @@ -0,0 +1,17 @@ +{ lib, config, ... }: +with lib; +let + cfg = config.home.homebrew.iterm; +in +{ + options.home.homebrew.iterm = { + enable = mkEnableOption "System iterm homebrew service"; + }; + config = mkIf cfg.enable { + + homebrew.casks = [ + "iterm2" + ]; + + }; +} diff --git a/modules/home/darwin/jetbrain.nix b/modules/home/darwin/jetbrain.nix new file mode 100644 index 0000000..e134e9a --- /dev/null +++ b/modules/home/darwin/jetbrain.nix @@ -0,0 +1,24 @@ +{ lib, config, ... }: +with lib; +let + cfg = config.home.homebrew.jetbrain; +in +{ + options.home.homebrew.jetbrain = { + enable = mkEnableOption "System jetbrain homebrew service"; + }; + config = mkIf cfg.enable { + + homebrew.casks = [ + "intellij-idea" + "pycharm" + "phpstorm" + "rustrover" + "goland" + "datagrip" + "dataspell" + "clion" + ]; + + }; +} diff --git a/modules/home/darwin/keka.nix b/modules/home/darwin/keka.nix new file mode 100644 index 0000000..385fc43 --- /dev/null +++ b/modules/home/darwin/keka.nix @@ -0,0 +1,17 @@ +{ lib, config, ... }: +with lib; +let + cfg = config.home.homebrew.keka; +in +{ + options.home.homebrew.keka = { + enable = mkEnableOption "System keka homebrew service"; + }; + config = mkIf cfg.enable { + + homebrew.casks = [ + "keka" + ]; + + }; +} diff --git a/modules/home/darwin/microsoft.nix b/modules/home/darwin/microsoft.nix new file mode 100644 index 0000000..f8ad288 --- /dev/null +++ b/modules/home/darwin/microsoft.nix @@ -0,0 +1,20 @@ +{ lib, config, ... }: +with lib; +let + cfg = config.home.homebrew.microsoft; +in +{ + options.home.homebrew.microsoft = { + enable = mkEnableOption "System microsoft homebrew service"; + }; + config = mkIf cfg.enable { + + homebrew.casks = [ + "microsoft-word" + "microsoft-excel" + "microsoft-powerpoint" + "microsoft-teams" + ]; + + }; +} diff --git a/modules/home/darwin/obsidian.nix b/modules/home/darwin/obsidian.nix new file mode 100644 index 0000000..6e05f52 --- /dev/null +++ b/modules/home/darwin/obsidian.nix @@ -0,0 +1,17 @@ +{ lib, config, ... }: +with lib; +let + cfg = config.home.homebrew.obsidian; +in +{ + options.home.homebrew.obsidian = { + enable = mkEnableOption "System obsidian homebrew service"; + }; + config = mkIf cfg.enable { + + homebrew.casks = [ + "obsidian" + ]; + + }; +} diff --git a/modules/home/darwin/zed.nix b/modules/home/darwin/zed.nix new file mode 100644 index 0000000..81d3ef5 --- /dev/null +++ b/modules/home/darwin/zed.nix @@ -0,0 +1,17 @@ +{ lib, config, ... }: +with lib; +let + cfg = config.home.homebrew.zed; +in +{ + options.home.homebrew.zed = { + enable = mkEnableOption "System zed homebrew service"; + }; + config = mkIf cfg.enable { + + homebrew.casks = [ + "zed" + ]; + + }; +} diff --git a/modules/home/darwin/zen.nix b/modules/home/darwin/zen.nix new file mode 100644 index 0000000..1564db2 --- /dev/null +++ b/modules/home/darwin/zen.nix @@ -0,0 +1,17 @@ +{ lib, config, ... }: +with lib; +let + cfg = config.home.homebrew.zen; +in +{ + options.home.homebrew.zen = { + enable = mkEnableOption "System zen homebrew service"; + }; + config = mkIf cfg.enable { + + homebrew.casks = [ + "zen" + ]; + + }; +} diff --git a/modules/users/options/ide/jetbrains/clion.nix b/modules/home/nixos/jetbrains/clion.nix similarity index 73% rename from modules/users/options/ide/jetbrains/clion.nix rename to modules/home/nixos/jetbrains/clion.nix index 2326698..ff9b3bd 100644 --- a/modules/users/options/ide/jetbrains/clion.nix +++ b/modules/home/nixos/jetbrains/clion.nix @@ -6,10 +6,10 @@ }: with lib; let - cfg = config.os.ide.jetbrains.clion; + cfg = config.home.ide.jetbrains.clion; in { - options.os.ide.jetbrains.clion = { + options.home.ide.jetbrains.clion = { enable = mkEnableOption "JetBrains options"; }; config = mkIf cfg.enable { diff --git a/modules/users/options/ide/jetbrains/datagrip.nix b/modules/home/nixos/jetbrains/datagrip.nix similarity index 71% rename from modules/users/options/ide/jetbrains/datagrip.nix rename to modules/home/nixos/jetbrains/datagrip.nix index 1979db2..94c4391 100644 --- a/modules/users/options/ide/jetbrains/datagrip.nix +++ b/modules/home/nixos/jetbrains/datagrip.nix @@ -6,10 +6,10 @@ }: with lib; let - cfg = config.os.ide.jetbrains.datagrip; + cfg = config.home.ide.jetbrains.datagrip; in { - options.os.ide.jetbrains.datagrip = { + options.home.ide.jetbrains.datagrip = { enable = mkEnableOption "JetBrains options"; }; config = mkIf cfg.enable { diff --git a/modules/users/options/ide/jetbrains/dataspell.nix b/modules/home/nixos/jetbrains/dataspell.nix similarity index 71% rename from modules/users/options/ide/jetbrains/dataspell.nix rename to modules/home/nixos/jetbrains/dataspell.nix index 3cc8767..ed47a25 100644 --- a/modules/users/options/ide/jetbrains/dataspell.nix +++ b/modules/home/nixos/jetbrains/dataspell.nix @@ -6,10 +6,10 @@ }: with lib; let - cfg = config.os.ide.jetbrains.dataspell; + cfg = config.home.ide.jetbrains.dataspell; in { - options.os.ide.jetbrains.dataspell = { + options.home.ide.jetbrains.dataspell = { enable = mkEnableOption "JetBrains options"; }; config = mkIf cfg.enable { diff --git a/modules/users/options/ide/jetbrains/goland.nix b/modules/home/nixos/jetbrains/goland.nix similarity index 72% rename from modules/users/options/ide/jetbrains/goland.nix rename to modules/home/nixos/jetbrains/goland.nix index b7a25e6..b8cafc9 100644 --- a/modules/users/options/ide/jetbrains/goland.nix +++ b/modules/home/nixos/jetbrains/goland.nix @@ -6,10 +6,10 @@ }: with lib; let - cfg = config.os.ide.jetbrains.goland; + cfg = config.home.ide.jetbrains.goland; in { - options.os.ide.jetbrains.goland = { + options.home.ide.jetbrains.goland = { enable = mkEnableOption "JetBrains options"; }; config = mkIf cfg.enable { diff --git a/modules/users/options/ide/jetbrains/idea.nix b/modules/home/nixos/jetbrains/idea.nix similarity index 73% rename from modules/users/options/ide/jetbrains/idea.nix rename to modules/home/nixos/jetbrains/idea.nix index c28bb65..37da7ee 100644 --- a/modules/users/options/ide/jetbrains/idea.nix +++ b/modules/home/nixos/jetbrains/idea.nix @@ -6,10 +6,10 @@ }: with lib; let - cfg = config.os.ide.jetbrains.idea; + cfg = config.home.ide.jetbrains.idea; in { - options.os.ide.jetbrains.idea = { + options.home.ide.jetbrains.idea = { enable = mkEnableOption "JetBrains options"; }; config = mkIf cfg.enable { diff --git a/modules/users/options/ide/jetbrains/phpstorm.nix b/modules/home/nixos/jetbrains/phpstorm.nix similarity index 71% rename from modules/users/options/ide/jetbrains/phpstorm.nix rename to modules/home/nixos/jetbrains/phpstorm.nix index d4a2420..51785af 100644 --- a/modules/users/options/ide/jetbrains/phpstorm.nix +++ b/modules/home/nixos/jetbrains/phpstorm.nix @@ -6,10 +6,10 @@ }: with lib; let - cfg = config.os.ide.jetbrains.phpstorm; + cfg = config.home.ide.jetbrains.phpstorm; in { - options.os.ide.jetbrains.phpstorm = { + options.home.ide.jetbrains.phpstorm = { enable = mkEnableOption "JetBrains options"; }; config = mkIf cfg.enable { diff --git a/modules/users/options/ide/jetbrains/pycharm.nix b/modules/home/nixos/jetbrains/pycharm.nix similarity index 72% rename from modules/users/options/ide/jetbrains/pycharm.nix rename to modules/home/nixos/jetbrains/pycharm.nix index ad941aa..a1391c2 100644 --- a/modules/users/options/ide/jetbrains/pycharm.nix +++ b/modules/home/nixos/jetbrains/pycharm.nix @@ -6,10 +6,10 @@ }: with lib; let - cfg = config.os.ide.jetbrains.pycharm; + cfg = config.home.ide.jetbrains.pycharm; in { - options.os.ide.jetbrains.pycharm = { + options.home.ide.jetbrains.pycharm = { enable = mkEnableOption "JetBrains options"; }; config = mkIf cfg.enable { diff --git a/modules/users/options/ide/jetbrains/rider.nix b/modules/home/nixos/jetbrains/rider.nix similarity index 73% rename from modules/users/options/ide/jetbrains/rider.nix rename to modules/home/nixos/jetbrains/rider.nix index 166c37c..de69e34 100644 --- a/modules/users/options/ide/jetbrains/rider.nix +++ b/modules/home/nixos/jetbrains/rider.nix @@ -6,10 +6,10 @@ }: with lib; let - cfg = config.os.ide.jetbrains.rider; + cfg = config.home.ide.jetbrains.rider; in { - options.os.ide.jetbrains.rider = { + options.home.ide.jetbrains.rider = { enable = mkEnableOption "JetBrains options"; }; config = mkIf cfg.enable { diff --git a/modules/users/options/ide/jetbrains/rubymine.nix b/modules/home/nixos/jetbrains/rubymine.nix similarity index 72% rename from modules/users/options/ide/jetbrains/rubymine.nix rename to modules/home/nixos/jetbrains/rubymine.nix index 98e9340..56d5040 100644 --- a/modules/users/options/ide/jetbrains/rubymine.nix +++ b/modules/home/nixos/jetbrains/rubymine.nix @@ -6,10 +6,10 @@ }: with lib; let - cfg = config.os.ide.jetbrains.rubymine; + cfg = config.home.ide.jetbrains.rubymine; in { - options.os.ide.jetbrains.rubymine = { + options.home.ide.jetbrains.rubymine = { enable = mkEnableOption "JetBrains options"; }; config = mkIf cfg.enable { diff --git a/modules/users/options/ide/jetbrains/rustrover.nix b/modules/home/nixos/jetbrains/rustrover.nix similarity index 71% rename from modules/users/options/ide/jetbrains/rustrover.nix rename to modules/home/nixos/jetbrains/rustrover.nix index 3fb0c02..3e17982 100644 --- a/modules/users/options/ide/jetbrains/rustrover.nix +++ b/modules/home/nixos/jetbrains/rustrover.nix @@ -6,10 +6,10 @@ }: with lib; let - cfg = config.os.ide.jetbrains.rustrover; + cfg = config.home.ide.jetbrains.rustrover; in { - options.os.ide.jetbrains.rustrover = { + options.home.ide.jetbrains.rustrover = { enable = mkEnableOption "JetBrains options"; }; config = mkIf cfg.enable { diff --git a/modules/users/options/ide/jetbrains/webstorm.nix b/modules/home/nixos/jetbrains/webstorm.nix similarity index 71% rename from modules/users/options/ide/jetbrains/webstorm.nix rename to modules/home/nixos/jetbrains/webstorm.nix index 40062a8..b6e7e89 100644 --- a/modules/users/options/ide/jetbrains/webstorm.nix +++ b/modules/home/nixos/jetbrains/webstorm.nix @@ -6,10 +6,10 @@ }: with lib; let - cfg = config.os.ide.jetbrains.webstorm; + cfg = config.home.ide.jetbrains.webstorm; in { - options.os.ide.jetbrains.webstorm = { + options.home.ide.jetbrains.webstorm = { enable = mkEnableOption "JetBrains options"; }; config = mkIf cfg.enable { diff --git a/modules/users/options/ide/obsidian.nix b/modules/home/nixos/obsidian.nix similarity index 73% rename from modules/users/options/ide/obsidian.nix rename to modules/home/nixos/obsidian.nix index 86011b3..35daa59 100644 --- a/modules/users/options/ide/obsidian.nix +++ b/modules/home/nixos/obsidian.nix @@ -6,17 +6,17 @@ }: with lib; let - cfg = config.os.editor.obsidian; + cfg = config.home.editor.obsidian; in { - options.os.editor.obsidian = { + options.home.editor.obsidian = { enable = mkEnableOption "Obsidian options"; }; config = mkIf cfg.enable { + home.packages = with pkgs; [ - obsidian - ]; + }; } diff --git a/modules/users/options/ide/zed.nix b/modules/home/nixos/zed.nix similarity index 73% rename from modules/users/options/ide/zed.nix rename to modules/home/nixos/zed.nix index 81b6f9c..06cc209 100644 --- a/modules/users/options/ide/zed.nix +++ b/modules/home/nixos/zed.nix @@ -6,20 +6,16 @@ }: with lib; let - cfg = config.os.ide.zed; + cfg = config.home.ide.zed; in { - options.os.ide.zed = { + options.home.ide.zed = { enable = mkEnableOption "Zen Editor options"; }; config = mkIf cfg.enable { home.packages = with pkgs; [ - zed-editor - nil - nixd - ]; }; diff --git a/modules/system/options/apps/sh/devenv.nix b/modules/system/common/devenv.nix similarity index 100% rename from modules/system/options/apps/sh/devenv.nix rename to modules/system/common/devenv.nix diff --git a/modules/system/common/neovim.nix b/modules/system/common/neovim.nix new file mode 100644 index 0000000..90d69a4 --- /dev/null +++ b/modules/system/common/neovim.nix @@ -0,0 +1,18 @@ +{ lib, config, ... }: +with lib; +let + cfg = config.os.shell.neovim; +in +{ + options.os.shell.neovim = { + enable = mkEnableOption "System neovim service"; + }; + config = mkIf cfg.enable { + + programs.neovim = { + enable = true; + defaultEditor = true; + }; + + }; +} diff --git a/modules/system/options/apps/sh/nh.nix b/modules/system/common/nh.nix similarity index 100% rename from modules/system/options/apps/sh/nh.nix rename to modules/system/common/nh.nix diff --git a/modules/system/options/apps/gnome/apps.nix b/modules/system/nixos/apps/gnome/apps.nix similarity index 100% rename from modules/system/options/apps/gnome/apps.nix rename to modules/system/nixos/apps/gnome/apps.nix diff --git a/modules/system/options/apps/gnome/shell.nix b/modules/system/nixos/apps/gnome/shell.nix similarity index 100% rename from modules/system/options/apps/gnome/shell.nix rename to modules/system/nixos/apps/gnome/shell.nix diff --git a/modules/system/options/apps/virtualisation/docker.nix b/modules/system/nixos/apps/virtualisation/docker.nix similarity index 100% rename from modules/system/options/apps/virtualisation/docker.nix rename to modules/system/nixos/apps/virtualisation/docker.nix diff --git a/modules/system/options/apps/virtualisation/podman.nix b/modules/system/nixos/apps/virtualisation/podman.nix similarity index 100% rename from modules/system/options/apps/virtualisation/podman.nix rename to modules/system/nixos/apps/virtualisation/podman.nix diff --git a/modules/system/options/nixos/boot/plymouth.nix b/modules/system/nixos/boot/plymouth.nix similarity index 100% rename from modules/system/options/nixos/boot/plymouth.nix rename to modules/system/nixos/boot/plymouth.nix diff --git a/modules/system/options/nixos/boot/systemd-boot.nix b/modules/system/nixos/boot/systemd-boot.nix similarity index 100% rename from modules/system/options/nixos/boot/systemd-boot.nix rename to modules/system/nixos/boot/systemd-boot.nix diff --git a/modules/system/options/nixos/graphics/cuda.nix b/modules/system/nixos/graphics/cuda.nix similarity index 100% rename from modules/system/options/nixos/graphics/cuda.nix rename to modules/system/nixos/graphics/cuda.nix diff --git a/modules/system/options/nixos/graphics/nvidia.nix b/modules/system/nixos/graphics/nvidia.nix similarity index 100% rename from modules/system/options/nixos/graphics/nvidia.nix rename to modules/system/nixos/graphics/nvidia.nix diff --git a/modules/system/options/nixos/keyboard-apple.nix b/modules/system/nixos/keyboard-apple.nix similarity index 100% rename from modules/system/options/nixos/keyboard-apple.nix rename to modules/system/nixos/keyboard-apple.nix diff --git a/modules/system/options/nixos/network/dns.nix b/modules/system/nixos/network/dns.nix similarity index 100% rename from modules/system/options/nixos/network/dns.nix rename to modules/system/nixos/network/dns.nix diff --git a/modules/system/options/nixos/network/manager.nix b/modules/system/nixos/network/manager.nix similarity index 100% rename from modules/system/options/nixos/network/manager.nix rename to modules/system/nixos/network/manager.nix diff --git a/modules/system/options/nixos/network/printing.nix b/modules/system/nixos/network/printing.nix similarity index 100% rename from modules/system/options/nixos/network/printing.nix rename to modules/system/nixos/network/printing.nix diff --git a/modules/system/options/nixos/network/samba.nix b/modules/system/nixos/network/samba.nix similarity index 100% rename from modules/system/options/nixos/network/samba.nix rename to modules/system/nixos/network/samba.nix diff --git a/modules/system/options/nixos/pipewire.nix b/modules/system/nixos/pipewire.nix similarity index 100% rename from modules/system/options/nixos/pipewire.nix rename to modules/system/nixos/pipewire.nix diff --git a/modules/system/options/apps/dev.nix b/modules/system/options/apps/dev.nix deleted file mode 100644 index 77b6f04..0000000 --- a/modules/system/options/apps/dev.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ - pkgs, - lib, - config, - ... -}: -with lib; -let - cfg = config.os.shell.dev; -in -{ - options.os.shell.dev = { - enable = mkEnableOption "System git service"; - }; - - config = mkIf cfg.enable { - environment.systemPackages = with pkgs; [ - gcc - ]; - }; -} diff --git a/modules/system/options/apps/git.nix b/modules/system/options/apps/git.nix deleted file mode 100644 index 82e5113..0000000 --- a/modules/system/options/apps/git.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ - pkgs, - lib, - config, - ... -}: -with lib; -let - cfg = config.os.shell.git; -in -{ - options.os.shell.git = { - enable = mkEnableOption "System git service"; - }; - config = mkIf cfg.enable { - - programs.git = { - enable = true; - config = { - init.defaultBranch = "main"; - }; - }; - - programs.ssh.enableAskPassword = false; - }; -} diff --git a/modules/users/home.nix b/modules/users/home.nix deleted file mode 100644 index 3f69bd6..0000000 --- a/modules/users/home.nix +++ /dev/null @@ -1,50 +0,0 @@ -{ import-tree, ... }: -{ - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.overwriteBackup = true; - home-manager.backupFileExtension = "bak"; - - home-manager.users = { - alistreaza = { - - imports = [ - (import-tree ./options) - (import-tree ./partials) - ]; - - home = { - username = "alistreaza"; - homeDirectory = "/home/alistreaza"; - }; - - # Apps shell - programs.git = { - settings = { - user = { - name = "Laurent Gueret"; - email = "gueretlob@pm.me"; - }; - }; - }; - - # Code editor - os.ide.zed.enable = true; - - # IDE Jetbrains - os.ide.jetbrains.idea.enable = false; - os.ide.jetbrains.pycharm.enable = false; - os.ide.jetbrains.phpstorm.enable = false; - os.ide.jetbrains.rustrover.enable = false; - - # IDE Data Jetbrains - os.ide.jetbrains.datagrip.enable = false; - os.ide.jetbrains.dataspell.enable = false; - - # Markdown Editor - os.editor.obsidian.enable = false; - - home.stateVersion = "25.11"; - }; - }; -}