diff options
-rw-r--r-- | README.md | 19 | ||||
-rw-r--r-- | flake.nix | 39 |
2 files changed, 34 insertions, 24 deletions
@@ -2,7 +2,7 @@ This repository fully describes my current NixOS user environment in a completely reproducible manner using [home-manager](https://github.com/rycee/home-manager/). Coupling this with the declarative system configuration in [nixos_system](https://code.kummerlaender.eu/nixos_system) I am able to trivially maintain a common computing environment across multiple machines. -Furthermore it is possible to reproduce this environment on a new computer within half an hour given a sufficiently good network connection. +Furthermore it is possible to reproduce this environment on a new computer in the time it takes to download and build the derivations. ## Overview @@ -10,15 +10,20 @@ The desktop environment consisting of XMonad, custom theming and a selection of `home-manager` doesn't have to be installed in the user environment and is only required for applying the configuration. -```sh -nix-shell --command "home-manager switch" -``` +## Host specific config -This shell also provides the `niv` utility used for updating the fixed channels. +The `host` folder contains a selection of host specific definitions to be selected via the hostname declared by the global system config. -## Host specific config +## Instantiation -The `host` folder contains a selection of host specific definitions to be selected by symlinking the desired configuration as `host/current.nix`. +If you are me and want to instantiate the setup on a new host: + +```sh +nix flake clone git+https://code.kummerlaender.eu/nixos_home -f dotfiles +cd dotfiles +cp host/$template.nix host/$hostname.nix +nix run --impure +``` ## Modules @@ -23,27 +23,32 @@ config = { allowUnfree = true; }; }; - in { - homeManagerConfigurations = { - common = home-manager.lib.homeManagerConfiguration { - configuration = { pkgs, ... }: { - _module.args = { - pkgs-personal = import personal { }; - pkgs-unstable = import nixpkgs-unstable { - inherit system; - config = { allowUnfree = true; }; - overlays = [ emacs.overlay ]; - }; - }; - imports = [ ./home.nix ]; - nixpkgs = { + home = home-manager.lib.homeManagerConfiguration { + configuration = { pkgs, ... }: { + _module.args = { + pkgs-personal = import personal { }; + pkgs-unstable = import nixpkgs-unstable { + inherit system; config = { allowUnfree = true; }; + overlays = [ emacs.overlay ]; }; }; - system = system; - homeDirectory = "/home/common"; - username = "common"; + imports = [ ./home.nix ]; + nixpkgs = { + config = { allowUnfree = true; }; + }; }; + system = system; + homeDirectory = "/home/common"; + username = "common"; + }; + + in { + defaultPackage.x86_64-linux = home.activationPackage; + + defaultApp.x86_64-linux = { + type = "app"; + program = "${home.activationPackage}/activate"; }; }; } |