{"id":14967930,"url":"https://github.com/misterio77/nix-starter-configs","last_synced_at":"2025-10-04T18:54:57.079Z","repository":{"id":44157107,"uuid":"439118950","full_name":"Misterio77/nix-starter-configs","owner":"Misterio77","description":"Simple and documented config templates to help you get started with NixOS + home-manager + flakes. All the boilerplate you need!","archived":false,"fork":false,"pushed_at":"2024-09-07T01:05:58.000Z","size":129,"stargazers_count":3125,"open_issues_count":25,"forks_count":161,"subscribers_count":48,"default_branch":"main","last_synced_at":"2025-05-22T00:09:54.311Z","etag":null,"topics":["dotfiles","flakes","home-manager","nix","nixos","starter","template"],"latest_commit_sha":null,"homepage":"","language":"Nix","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Misterio77.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-16T20:29:26.000Z","updated_at":"2025-05-21T17:21:52.000Z","dependencies_parsed_at":"2023-11-12T14:36:49.473Z","dependency_job_id":"4e573d2a-1f97-4ef7-a654-aeaa0f971f9d","html_url":"https://github.com/Misterio77/nix-starter-configs","commit_stats":{"total_commits":96,"total_committers":12,"mean_commits":8.0,"dds":"0.48958333333333337","last_synced_commit":"cd2634edb7742a5b4bbf6520a2403c22be7013c6"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Misterio77/nix-starter-configs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Misterio77%2Fnix-starter-configs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Misterio77%2Fnix-starter-configs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Misterio77%2Fnix-starter-configs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Misterio77%2Fnix-starter-configs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Misterio77","download_url":"https://codeload.github.com/Misterio77/nix-starter-configs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Misterio77%2Fnix-starter-configs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278358489,"owners_count":25973949,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dotfiles","flakes","home-manager","nix","nixos","starter","template"],"created_at":"2024-09-24T13:38:53.798Z","updated_at":"2025-10-04T18:54:57.047Z","avatar_url":"https://github.com/Misterio77.png","language":"Nix","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e [!IMPORTANT]  \n\u003e This repo is a little out of date at the moment, and is pending a refactor. Please check official documentation for NixOS and home-manager to make sure you're doing things right. See https://github.com/Misterio77/nix-starter-configs/issues/86 for more info.\n\n# Nix Starter Config\n\nThis repo contains a few a simple nix flake templates for getting started with\nNixOS + home-manager.\n\n# What this provides\n\n- [Minimal version](./minimal):\n    - NixOS configuration on `nixos/configuration.nix`, accessible via\n      `nixos-rebuild --flake .`\n    - Home-manager configuration on `home-manager/home.nix`, accessible via\n      `home-manager --flake .`\n- [Standard version](./standard):\n    - Basic boilerplate for adding custom packages (under `pkgs`) and overlays\n      (under `overlay`). Accessible on your system, home config, as well as `nix\n      build .#package-name`.\n    - Boilerplate for custom NixOS (`modules/nixos`) and home-manager\n      (`modules/home-manager`) modules\n    - NixOS and home-manager configurations from minimal, and they should\n      also use your overlays and custom packages right out of the box.\n\n# Getting started\n\nAssuming you have a basic NixOS booted up (either live or installed, anything\nworks). [Here's a link to the latest NixOS downloads, just for\nyou](https://nixos.org/download#download-nixos).\n\nAlternatively, you can totally use `nix` and `home-manager` on your existing\ndistro (or even on Darwin). [Install nix](https://nixos.org/download.html#nix)\nand follow along (just ignore the `nixos-*` commands).\n\n## What template to chose?\n\nIf this is your first trying flakes, or you're attempting to migrate your\n(simple) config to it; you should use the minimal version.\n\nIf you're here looking for inspiration/tips/good practices (and you already use\nflakes), or you're migrating a config that already has overlays and custom\npackages; try the standard version.\n\n## I like your funny words, magic man\n\nNot sure what this all means?\n\nTake a look at [the learn hub on the NixOS\nwebsite](https://nixos.org/learn.html) (scroll down to guides, the manuals, and\nthe other awesome learning resources).\n\nLearning the basics of what Nix (the package manager) is, how the Nix language\nworks, and a bit of NixOS basics should get you up and running. Don't worry if\nit seems a little confusing at first. Get confortable with the basic concepts\nand come back here to get your feet wet, it's the best way to learn!\n\n## The repo\n\n- [Install git](https://nixos.wiki/wiki/git), if you haven't already.\n- Create a repository for your config, for example:\n```bash\ncd ~/Documents\ngit init nix-config\ncd nix-config\n```\n- Make sure you're running Nix 2.4+, and opt into the experimental `flakes` and `nix-command` features:\n```bash\n# Should be 2.4+\nnix --version\nexport NIX_CONFIG=\"experimental-features = nix-command flakes\"\n```\n- Get the template:\n```bash\n# For minimal version\nnix flake init -t github:misterio77/nix-starter-config#minimal\n\n# For standard version\nnix flake init -t github:misterio77/nix-starter-config#standard\n```\n- If you want to use NixOS: add stuff you currently have on `/etc/nixos/` to\n  `nixos` (usually `configuration.nix` and `hardware-configuration.nix`, when\n  you're starting out).\n    - The included file has some options you might want, specially if you don't\n      have a configuration ready. Make sure you have generated your own\n      `hardware-configuration.nix`; if not, just mount your partitions to\n      `/mnt` and run: `nixos-generate-config --root /mnt`.\n- If you want to use home-manager: add your stuff from `~/.config/nixpkgs`\n  to `home-manager` (probably `home.nix`).\n  - The included file is also a good starting point if you don't have a config\n    yet.\n- Take a look at `flake.nix`, making sure to fill out anything marked with\n  FIXME (required) or TODO (usually tips or optional stuff you might want)\n- Update your flake lock with `nix flake update`, so you get the latest\n  packages and modules\n- `git add` and `git push` your changes! Or at least copy them somewhere if\n  you're on a live medium.\n\n## Usage\n\n- Run `sudo nixos-rebuild switch --flake .#hostname` to apply your system\n  configuration.\n    - If you're still on a live installation medium, run `nixos-install --flake\n      .#hostname` instead, and reboot.\n- Run `home-manager switch --flake .#username@hostname` to apply your home\n  configuration.\n  - If you don't have home-manager installed, try `nix shell nixpkgs#home-manager`.\n\nAnd that's it, really! You're ready to have fun with your configurations using\nthe latest and greatest nix3 flake-enabled command UX.\n\n# What next?\n\n## Use home-manager as a NixOS module\n\nIf you prefer to build your home configuration together with your NixOS one,\nit's pretty simple.\n\nSimply remove the `homeConfigurations` block from the `flake.nix` file; then\nadd this to your NixOS configuration (either directly on\n`nixos/configuration.nix` or on a separate file and import it):\n\n```nix\n{ inputs, outputs, ... }: {\n  imports = [\n    # Import home-manager's NixOS module\n    inputs.home-manager.nixosModules.home-manager\n  ];\n\n  home-manager = {\n    extraSpecialArgs = { inherit inputs outputs; };\n    users = {\n      # Import your home-manager configuration\n      your-username = import ../home-manager/home.nix;\n    };\n  };\n}\n```\n\nIn this setup, the `home-manager` tool will not be installed (see\n[nix-community/home-manager#4342](https://github.com/nix-community/home-manager/pull/4342)).\nTo rebuild your home configuration, use `nixos-rebuild` instead.\n\nBut if you want to install the `home-manager` tool anyways, you can add the\npackage into your configuration:\n\n```nix\n# To install it for a specific user\nusers.users = {\n  your-username = {\n    packages = [ inputs.home-manager.packages.${pkgs.system}.default ];\n  };\n};\n\n# To install it globally\nenvironment.systemPackages =\n  [ inputs.home-manager.packages.${pkgs.system}.default ];\n```\n\n## Adding more hosts or users\n\nYou can organize them by hostname and username on `nixos` and `home-manager`\ndirectories, be sure to also add them to `flake.nix`.\n\nYou can take a look at my (beware, here be reproductible dragons)\n[configuration repo](https://github.com/misterio77/nix-config) for ideas.\n\nNixOS makes it easy to share common configuration between hosts (you might want\nto create a common directory for these), while keeping everything in sync.\nhome-manager can help you sync your environment (from editor to WM and\neverything in between) anywhere you use it. Have fun!\n\n## User password and secrets\n\nYou have basically two ways of setting up default passwords:\n- By default, you'll be prompted for a root password when installing with\n  `nixos-install`. After you reboot, be sure to add a password to your own\n  account and lock root using `sudo passwd -l root`.\n- Alternatively, you can specify `initialPassword` for your user. This will\n  give your account a default password, be sure to change it after rebooting!\n  If you do, you should pass `--no-root-passwd` to `nixos-install`, to skip\n  setting a password on the root account.\n\nIf you don't want to set your password imperatively, you can also use\n`passwordFile` for safely and declaratively setting a password from a file\noutside the nix store.\n\nThere's also [more advanced options for secret\nmanagement](https://nixos.wiki/wiki/Comparison_of_secret_managing_schemes),\nincluding some that can include them (encrypted) into your config repo and/or\nnix store, be sure to check them out if you're interested.\n\n## Dotfile management with home-manager\n\nBesides just adding packages to your environment, home-manager can also manage\nyour dotfiles. I strongly recommend you do, it's awesome!\n\nFor full nix goodness, check out the home-manager options with `man\nhome-configuration.nix`. Using them, you'll be able to fully configure any\nprogram with nix syntax and its powerful abstractions.\n\nAlternatively, if you're still not ready to rewrite all your configs to nix\nsyntax, there's home-manager options (such as `xdg.configFile`) for including\nfiles from your config repository into your usual dot directories. Add your\nexisting dotfiles to this repo and try it out!\n\n## Try opt-in persistance\n\nYou might have noticed that there's impurity in your NixOS system, in the form\nof configuration files and other cruft your system generates when running. What\nif you change them in a whim to get something working and forget about it?\nBoom, your system is not fully reproductible anymore.\n\nYou can instead fully delete your `/` and `/home` on every boot! Nix is okay\nwith a empty root on boot (all you need is `/boot` and `/nix`), and will\nhappily reapply your configurations.\n\nThere's two main approaches to this: mount a `tmpfs` (RAM disk) to `/`, or\n(using a filesystem such as btrfs or zfs) mount a blank snapshot and reset it\non boot.\n\nFor stuff that can't be managed through nix (such as games downloaded from\nsteam, or logs), use [impermanence](https://github.com/nix-community/impermanence)\nfor mounting stuff you to keep to a separate partition/volume (such as\n`/nix/persist` or `/persist`). This makes everything vanish by default, and you\ncan keep track of what you specifically asked to be kept.\n\nHere's some awesome blog posts about it:\n- [Erase your darlings](https://grahamc.com/blog/erase-your-darlings)\n- [Encrypted BTRFS with Opt-In State on\n  NixOS](https://mt-caret.github.io/blog/posts/2020-06-29-optin-state.html)\n- [NixOS: tmpfs as root](https://elis.nu/blog/2020/05/nixos-tmpfs-as-root/) and\n  [tmpfs as home](https://elis.nu/blog/2020/06/nixos-tmpfs-as-home/)\n\nNote that for `home-manager` to work correctly here, you need to set up its\nNixOS module, as described in the [previous section](#use-home-manager-as-a-nixos-module).\n\n## Adding custom packages\n\nSomething you want to use that's not in nixpkgs yet? You can easily build and\niterate on a derivation (package) from this very repository.\n\nCreate a folder with the desired name inside `pkgs`, and add a `default.nix`\nfile containing a derivation. Be sure to also `callPackage` them on\n`pkgs/default.nix`.\n\nYou'll be able to refer to that package from anywhere on your\nhome-manager/nixos configurations, build them with `nix build .#package-name`,\nor bring them into your shell with `nix shell .#package-name`.\n\nSee [the manual](https://nixos.org/manual/nixpkgs/stable/) for some tips on how\nto package stuff.\n\n## Adding overlays\n\nFound some outdated package on nixpkgs you need the latest version of? Perhaps\nyou want to apply a patch to fix a behaviour you don't like? Nix makes it easy\nand manageble with overlays!\n\nUse the `overlays/default.nix` file for this.\n\nIf you're creating patches, you can keep them on the `overlays` folder as well.\n\nSee [the wiki article](https://nixos.wiki/wiki/Overlays) to see how it all\nworks.\n\n## Adding your own modules\n\nGot some configurations you want to create an abstraction of? Modules are the\nanswer. These awesome files can expose _options_ and implement _configurations_\nbased on how the options are set.\n\nCreate a file for them on either `modules/nixos` or `modules/home-manager`. Be\nsure to also add them to the listing at `modules/nixos/default.nix` or\n`modules/home-manager/default.nix`.\n\nSee [the wiki article](https://nixos.wiki/wiki/Module) to learn more about\nthem.\n\n# Troubleshooting / FAQ\n\nPlease [let me know](https://github.com/Misterio77/nix-starter-config/issues)\nany questions or issues you face with these templates, so I can add more info\nhere!\n\n## Nix says my repo files don't exist, even though they do!\n\nNix flakes only see files that git is currently tracked, so just `git add .`\nand you should be good to go. Files on `.gitignore`, of course, are invisible\nto nix - this is to guarantee your build won't depend on anything that is not\non your repo.\n\n## Nix installs the wrong version of software/fails to find new software\n\nThe nix dependencies (such as `nixpkgs`) used by your configuration will\nstrictly follow the `flake.lock` file, using the commits written into it when\nyou (re)generated.\n\nTo update your flake inputs, simply use `nix flake update`.\n\n\u003c!--\n# Learning resources\nTODO\n--\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmisterio77%2Fnix-starter-configs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmisterio77%2Fnix-starter-configs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmisterio77%2Fnix-starter-configs/lists"}