From fe4fd511f59c0166e3ebe12240bcbed7225dbeb6 Mon Sep 17 00:00:00 2001 From: Sebastian Estrella <2049686+sestrella@users.noreply.github.com> Date: Sat, 21 Oct 2023 02:34:41 -0500 Subject: [PATCH 1/5] Update flake.nix --- flake.lock | 361 +----------------------------------------------- flake.nix | 84 +++-------- home.nix | 33 +++-- home/neovim.nix | 2 +- 4 files changed, 50 insertions(+), 430 deletions(-) diff --git a/flake.lock b/flake.lock index 88accb4..5e77d56 100644 --- a/flake.lock +++ b/flake.lock @@ -1,154 +1,5 @@ { "nodes": { - "auto-dark-mode": { - "flake": false, - "locked": { - "lastModified": 1695457749, - "narHash": "sha256-uJ4LxczgWl4aQCFuG4cR+2zwhNo7HB6R7ZPTdgjvyfY=", - "owner": "f-person", - "repo": "auto-dark-mode.nvim", - "rev": "76e8d40d1e1544bae430f739d827391cbcb42fcc", - "type": "github" - }, - "original": { - "owner": "f-person", - "repo": "auto-dark-mode.nvim", - "type": "github" - } - }, - "darwin": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1696360011, - "narHash": "sha256-HpPv27qMuPou4acXcZ8Klm7Zt0Elv9dgDvSJaomWb9Y=", - "owner": "LnL7", - "repo": "nix-darwin", - "rev": "8b6ea26d5d2e8359d06278364f41fbc4b903b28a", - "type": "github" - }, - "original": { - "owner": "LnL7", - "repo": "nix-darwin", - "type": "github" - } - }, - "devenv": { - "inputs": { - "flake-compat": "flake-compat", - "nix": "nix", - "nixpkgs": "nixpkgs", - "pre-commit-hooks": "pre-commit-hooks" - }, - "locked": { - "lastModified": 1696344641, - "narHash": "sha256-cfGsdtDvzYaFA7oGWSgcd1yST6LFwvjMcHvtVj56VcU=", - "owner": "cachix", - "repo": "devenv", - "rev": "05e26941f34486bff6ebeb4b9c169b6f637f1758", - "type": "github" - }, - "original": { - "owner": "cachix", - "repo": "devenv", - "type": "github" - } - }, - "flake-compat": { - "flake": false, - "locked": { - "lastModified": 1673956053, - "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1685518550, - "narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_2": { - "inputs": { - "systems": "systems_2" - }, - "locked": { - "lastModified": 1694529238, - "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_3": { - "inputs": { - "systems": "systems_3" - }, - "locked": { - "lastModified": 1694529238, - "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "gitignore": { - "inputs": { - "nixpkgs": [ - "devenv", - "pre-commit-hooks", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1660459072, - "narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=", - "owner": "hercules-ci", - "repo": "gitignore.nix", - "rev": "a20de23b925fd8264fd7fad6454652e142fd7f73", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "gitignore.nix", - "type": "github" - } - }, "home-manager": { "inputs": { "nixpkgs": [ @@ -169,224 +20,26 @@ "type": "github" } }, - "lowdown-src": { - "flake": false, - "locked": { - "lastModified": 1633514407, - "narHash": "sha256-Dw32tiMjdK9t3ETl5fzGrutQTzh2rufgZV4A/BbxuD4=", - "owner": "kristapsdz", - "repo": "lowdown", - "rev": "d2c2b44ff6c27b936ec27358a2653caaef8f73b8", - "type": "github" - }, - "original": { - "owner": "kristapsdz", - "repo": "lowdown", - "type": "github" - } - }, - "nix": { - "inputs": { - "lowdown-src": "lowdown-src", - "nixpkgs": [ - "devenv", - "nixpkgs" - ], - "nixpkgs-regression": "nixpkgs-regression" - }, - "locked": { - "lastModified": 1676545802, - "narHash": "sha256-EK4rZ+Hd5hsvXnzSzk2ikhStJnD63odF7SzsQ8CuSPU=", - "owner": "domenkozar", - "repo": "nix", - "rev": "7c91803598ffbcfe4a55c44ac6d49b2cf07a527f", - "type": "github" - }, - "original": { - "owner": "domenkozar", - "ref": "relaxed-flakes", - "repo": "nix", - "type": "github" - } - }, "nixpkgs": { "locked": { - "lastModified": 1678875422, - "narHash": "sha256-T3o6NcQPwXjxJMn2shz86Chch4ljXgZn746c2caGxd8=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "126f49a01de5b7e35a43fd43f891ecf6d3a51459", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-regression": { - "locked": { - "lastModified": 1643052045, - "narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", - "type": "github" - }, - "original": { - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", - "type": "github" - } - }, - "nixpkgs-stable": { - "locked": { - "lastModified": 1685801374, - "narHash": "sha256-otaSUoFEMM+LjBI1XL/xGB5ao6IwnZOXc47qhIgJe8U=", - "owner": "NixOS", + "lastModified": 1697723726, + "narHash": "sha256-SaTWPkI8a5xSHX/rrKzUe+/uVNy6zCGMXgoeMb7T9rg=", + "owner": "nixos", "repo": "nixpkgs", - "rev": "c37ca420157f4abc31e26f436c1145f8951ff373", + "rev": "7c9cc5a6e5d38010801741ac830a3f8fd667a7a0", "type": "github" }, "original": { - "owner": "NixOS", - "ref": "nixos-23.05", + "owner": "nixos", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } }, - "nixpkgs_2": { - "locked": { - "lastModified": 1696419054, - "narHash": "sha256-EdR+dIKCfqL3voZUDYwcvgRDOektQB9KbhBVcE0/3Mo=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "7131f3c223a2d799568e4b278380cd9dac2b8579", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_3": { - "locked": { - "lastModified": 1696419054, - "narHash": "sha256-EdR+dIKCfqL3voZUDYwcvgRDOektQB9KbhBVcE0/3Mo=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "7131f3c223a2d799568e4b278380cd9dac2b8579", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "pre-commit-hooks": { - "inputs": { - "flake-compat": [ - "devenv", - "flake-compat" - ], - "flake-utils": "flake-utils", - "gitignore": "gitignore", - "nixpkgs": [ - "devenv", - "nixpkgs" - ], - "nixpkgs-stable": "nixpkgs-stable" - }, - "locked": { - "lastModified": 1688056373, - "narHash": "sha256-2+SDlNRTKsgo3LBRiMUcoEUb6sDViRNQhzJquZ4koOI=", - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "rev": "5843cf069272d92b60c3ed9e55b7a8989c01d4c7", - "type": "github" - }, - "original": { - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "type": "github" - } - }, "root": { "inputs": { - "darwin": "darwin", - "devenv": "devenv", - "flake-utils": "flake-utils_2", "home-manager": "home-manager", - "nixpkgs": "nixpkgs_2", - "vim-plugins": "vim-plugins" - } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, - "systems_2": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, - "systems_3": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, - "vim-plugins": { - "inputs": { - "auto-dark-mode": "auto-dark-mode", - "flake-utils": "flake-utils_3", - "nixpkgs": "nixpkgs_3" - }, - "locked": { - "lastModified": 1, - "narHash": "sha256-Ienx/DvbEUkHDEb6QyDKJYqJHz+N5BszZWokhAnJI4U=", - "path": "flakes/vim-plugins", - "type": "path" - }, - "original": { - "path": "flakes/vim-plugins", - "type": "path" + "nixpkgs": "nixpkgs" } } }, diff --git a/flake.nix b/flake.nix index ed5ff27..1014fc4 100644 --- a/flake.nix +++ b/flake.nix @@ -1,71 +1,29 @@ { - # https://nix-community.github.io/home-manager/index.html#sec-flakes-nix-darwin-module + description = "Home Manager configuration of sestrella"; + inputs = { - # auto-dark-mode.flake = false; - # auto-dark-mode.url = "github:f-person/auto-dark-mode.nvim"; - darwin.inputs.nixpkgs.follows = "nixpkgs"; - darwin.url = "github:LnL7/nix-darwin"; - devenv.url = "github:cachix/devenv"; - flake-utils.url = "github:numtide/flake-utils"; - home-manager.inputs.nixpkgs.follows = "nixpkgs"; - home-manager.url = "github:nix-community/home-manager"; - nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; - vim-plugins.url = "path:flakes/vim-plugins"; + # Specify the source of Home Manager and Nixpkgs. + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; - outputs = - { self - , vim-plugins - , darwin - , devenv - , flake-utils - , home-manager - , nixpkgs - }@inputs: + outputs = { nixpkgs, home-manager, ... }: let - mkDarwinSystem = system: darwin.lib.darwinSystem { - inherit system; - modules = [ - ./configuration.nix - home-manager.darwinModules.home-manager - { - home-manager = { - backupFileExtension = "bak"; - extraSpecialArgs = { vim-plugins-overlays = inputs.vim-plugins.overlays.${system}; }; - users.sestrella = import ./home.nix; - }; - } - ]; - }; - in - { - darwinConfigurations = { - ci = mkDarwinSystem "x86_64-darwin"; - work = mkDarwinSystem "aarch64-darwin"; - }; + system = "aarch64-darwin"; + pkgs = nixpkgs.legacyPackages.${system}; + in { + homeConfigurations."sestrella" = home-manager.lib.homeManagerConfiguration { + inherit pkgs; - } // flake-utils.lib.eachSystem [ "aarch64-darwin" "x86_64-darwin" ] - (system: - let - pkgs = nixpkgs.legacyPackages.${system}; - in - { - devShells.default = devenv.lib.mkShell { - inherit inputs pkgs; - modules = [ - ({ pkgs, ... }: { - packages = [ - pkgs.gitleaks - ]; + # Specify your home configuration modules here, for example, + # the path to your home.nix. + modules = [ ./home.nix ]; - pre-commit.hooks = { - luacheck.enable = true; - nixpkgs-fmt.enable = true; - stylua.enable = true; - yamllint.enable = true; - }; - }) - ]; - }; - }); + # Optionally use extraSpecialArgs + # to pass through arguments to home.nix + }; + }; } diff --git a/home.nix b/home.nix index c2132d9..ab77003 100644 --- a/home.nix +++ b/home.nix @@ -1,15 +1,19 @@ -{ config, pkgs, vim-plugins-overlays, ... }: +{ config, pkgs, ... }: { - # This value determines the Home Manager release that your - # configuration is compatible with. This helps avoid breakage - # when a new Home Manager release introduces backwards - # incompatible changes. + # Home Manager needs a bit of information about you and the paths it should + # manage. + home.username = "sestrella"; + home.homeDirectory = "/Users/sestrella"; + + # This value determines the Home Manager release that your configuration is + # compatible with. This helps avoid breakage when a new Home Manager release + # introduces backwards incompatible changes. # - # You can update Home Manager without changing this value. See - # the Home Manager release notes for a list of state version - # changes in each release. - home.stateVersion = "22.11"; + # You should not change this value, even if you update Home Manager. If you do + # want to update the value, then make sure to first check the Home Manager + # release notes. + home.stateVersion = "23.05"; # Please read the comment before changing. # Custom configuration imports = [ @@ -62,11 +66,16 @@ shellAbbrs.nfid = '' nix flake init --template github:cachix/devenv#flake-parts ''; + shellInit = '' + # https://github.com/Homebrew/brew/blob/master/Library/Homebrew/cmd/shellenv.sh + eval (/opt/homebrew/bin/brew shellenv) + . /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.fish + ''; }; programs.starship.enable = true; - nixpkgs.overlays = [ - vim-plugins-overlays.default - ]; + # nixpkgs.overlays = [ + # vim-plugins-overlays.default + # ]; } diff --git a/home/neovim.nix b/home/neovim.nix index 953d1bb..208a80e 100644 --- a/home/neovim.nix +++ b/home/neovim.nix @@ -15,7 +15,7 @@ ]; extraLuaConfig = builtins.readFile ./neovim/extra-config.lua; plugins = builtins.concatMap (plugin: pkgs.callPackage plugin { }) [ - ./neovim/plugins/auto-dark-mode.nix + # ./neovim/plugins/auto-dark-mode.nix ./neovim/plugins/cmp.nix ./neovim/plugins/comment.nix ./neovim/plugins/lspconfig.nix From 6d79fd68ef5c0fa605d9f08f4c66280407246c2f Mon Sep 17 00:00:00 2001 From: Sebastian Estrella <2049686+sestrella@users.noreply.github.com> Date: Sat, 21 Oct 2023 02:38:48 -0500 Subject: [PATCH 2/5] Update README file --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 9886f32..c7fe20b 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# [nix-darwin] configuration +# Home Manager Configuration [![CI](https://github.com/sestrella/nix-home/actions/workflows/ci.yml/badge.svg)](https://github.com/sestrella/nix-home/actions/workflows/ci.yml) -My system configuration managed via `nix-darwin`. +My [Home Manager][home-manager] configuration ## Requirements @@ -11,16 +11,16 @@ My system configuration managed via `nix-darwin`. ## Getting Started -Activate the system configuration for the first time: +Clone the repository: -```sh -nix build .#darwinConfigurations.work.system +``` +git clone https://github.com/sestrella/nix-darwin-config.git ~/.config/home-manager ``` -Next time, update system configuration running the following command: +Activate the configuration: -```sh -./bin/switch +``` +nix run home-manager/master -- init --switch ``` ## Inspired By @@ -31,4 +31,4 @@ A list of repositories that inspired this one: - [gvolpe/nix-config](https://github.com/gvolpe/nix-config/) - [ryantm/home-manager-template](https://github.com/ryantm/home-manager-template/) -[nix-darwin]: https://github.com/LnL7/nix-darwin +[home-manager]: https://github.com/nix-community/home-manager From de6c30eb4b4bc93d8619c9ade82a1819c91e3094 Mon Sep 17 00:00:00 2001 From: Sebastian Estrella <2049686+sestrella@users.noreply.github.com> Date: Sat, 21 Oct 2023 02:44:05 -0500 Subject: [PATCH 3/5] Update references --- README.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index c7fe20b..6723db6 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,15 @@ [![CI](https://github.com/sestrella/nix-home/actions/workflows/ci.yml/badge.svg)](https://github.com/sestrella/nix-home/actions/workflows/ci.yml) -My [Home Manager][home-manager] configuration +My [Home Manager](https://github.com/nix-community/home-manager) configuration. ## Requirements -- Install [Nix](https://nixos.org/guides/install-nix.html) -- Enable [Flakes](https://nixos.wiki/wiki/Flakes#Permanent) permanently +- Install Nix via [nix-installer](https://github.com/DeterminateSystems/nix-installer) + +Alternatively, use the official +[installer](https://nixos.org/guides/install-nix.html) and enable +[Flakes](https://nixos.wiki/wiki/Flakes). ## Getting Started @@ -25,10 +28,8 @@ nix run home-manager/master -- init --switch ## Inspired By -A list of repositories that inspired this one: - -- [HugoReeves/nix-home](https://github.com/HugoReeves/nix-home/) -- [gvolpe/nix-config](https://github.com/gvolpe/nix-config/) -- [ryantm/home-manager-template](https://github.com/ryantm/home-manager-template/) +A list of projects that inspired me to write this one: -[home-manager]: https://github.com/nix-community/home-manager +- https://github.com/HugoReeves/nix-home +- https://github.com/gvolpe/nix-config +- https://github.com/ryantm/home-manager-template From ed538ba7f2bb4339c713c678bf54be8f50de8ad6 Mon Sep 17 00:00:00 2001 From: Sebastian Estrella <2049686+sestrella@users.noreply.github.com> Date: Sat, 21 Oct 2023 02:47:29 -0500 Subject: [PATCH 4/5] Update CI workflow --- .github/workflows/ci.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d78fc11..4c1e218 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,10 +9,9 @@ concurrency: jobs: build: - runs-on: macos-latest + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: cachix/install-nix-action@v22 - - run: nix build .#darwinConfigurations.ci.system - # FIXME: error: Directory /run does not exist, aborting activation - # - run: ./result/sw/bin/darwin-rebuild switch --flake .#ci + - uses: DeterminateSystems/flake-checker-action@v5 + - uses: DeterminateSystems/nix-installer-action@v6 + - run: nix run home-manager/master -- init --switch From 272cadcff8c5d5b0929b47372e9707e4d7b2eb67 Mon Sep 17 00:00:00 2001 From: Sebastian Estrella <2049686+sestrella@users.noreply.github.com> Date: Sat, 21 Oct 2023 02:50:24 -0500 Subject: [PATCH 5/5] Update status badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6723db6..93d41e2 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Home Manager Configuration -[![CI](https://github.com/sestrella/nix-home/actions/workflows/ci.yml/badge.svg)](https://github.com/sestrella/nix-home/actions/workflows/ci.yml) +[![CI](https://github.com/sestrella/home-manager.config/actions/workflows/ci.yml/badge.svg)](https://github.com/sestrella/home-manager.config/actions/workflows/ci.yml) My [Home Manager](https://github.com/nix-community/home-manager) configuration.