add documentation and nix with flakes to devshell
This commit is contained in:
parent
0d5ca8396c
commit
cfbd78cda2
28
README.md
Normal file
28
README.md
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
# Nix Starter Config
|
||||||
|
|
||||||
|
This is a minimal (yet complete) nix flake for getting started with NixOS + home-manager.
|
||||||
|
|
||||||
|
## What this provides
|
||||||
|
|
||||||
|
- NixOS configuration on `configuration.nix`, accessible via `nixos-rebuild --flake`
|
||||||
|
- Home-manager configuration on `home.nix`, accessible via `home-manager --flake`
|
||||||
|
- Basic boilerplate for adding custom packages (under `pkgs`) and overlays (on `overlays.nix`). Acessible on your system, home config, as well as `nix build .#package-name`
|
||||||
|
- Dev shell for bootstrapping, accessible via `nix develop`
|
||||||
|
|
||||||
|
## How to get started
|
||||||
|
|
||||||
|
Assuming you have a basic NixOS installation up and running:
|
||||||
|
|
||||||
|
### Getting the repo
|
||||||
|
- [Install git](https://nixos.wiki/wiki/git)
|
||||||
|
- Clone this repo to somewhere acessible (i usually have a `/dotfiles` folder for this)
|
||||||
|
- Add stuff you currently have on `/etc/nixos/configuration.nix` to `configuration.nix`, and `/etc/nixos/hardware-configuration.nix` to `hardware-configuration.nix`
|
||||||
|
- If you're already using home-manager, add your stuff from `~/.config/nixpkgs/home.nix` to `home.nix`
|
||||||
|
- Take a look at `flake.nix`, filling out stuff marked by `TODO`s
|
||||||
|
- Create a remote repo (github, gitlab, sr.ht, etc) and push your changes for safekeeping
|
||||||
|
|
||||||
|
### Bootstrapping
|
||||||
|
- Run `nix-shell` (or `nix develop`, if you already have flakes enabled) to bootstrap into flake-enabled nix and home-manager.
|
||||||
|
- Run `sudo nixos-rebuild switch --flake .` to apply system configuration
|
||||||
|
- Run `home-manager switch --flake .` to apply home configuration
|
||||||
|
- Reboot!
|
|
@ -22,6 +22,14 @@
|
||||||
# Comment out if you wish to disable unfree packages for your system
|
# Comment out if you wish to disable unfree packages for your system
|
||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
|
||||||
|
# Enable flakes and 'nix' command
|
||||||
|
nix = {
|
||||||
|
package = pkgs.nixFlakes;
|
||||||
|
extraOptions = ''
|
||||||
|
experimental-features = nix-command flakes
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
# This will make all users source .nix-profile on login, activating home
|
# This will make all users source .nix-profile on login, activating home
|
||||||
# manager automatically. Will allow you to use home-manager standalone on
|
# manager automatically. Will allow you to use home-manager standalone on
|
||||||
# setups with opt-in persistance.
|
# setups with opt-in persistance.
|
||||||
|
|
|
@ -71,6 +71,9 @@
|
||||||
// utils.lib.eachDefaultSystem (system:
|
// utils.lib.eachDefaultSystem (system:
|
||||||
let
|
let
|
||||||
pkgs = import nixpkgs { inherit system; overlays = self.overlays; };
|
pkgs = import nixpkgs { inherit system; overlays = self.overlays; };
|
||||||
|
nix = pkgs.writeShellScriptBin "nix" ''
|
||||||
|
exec ${pkgs.nixFlakes}/bin/nix --experimental-features "nix-command flakes" "$@"
|
||||||
|
'';
|
||||||
hm = home-manager.defaultPackage."${system}";
|
hm = home-manager.defaultPackage."${system}";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue