From 8ec6ada4b1fb7c10b5abda1216daa4502b01ada3 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Wed, 18 Aug 2021 18:46:32 +0200 Subject: Set default derivation, update README --- README.md | 19 ++++++++++++------- flake.nix | 39 ++++++++++++++++++++++----------------- 2 files changed, 34 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 4137dde..85b0eac 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/flake.nix b/flake.nix index 7388919..1581269 100644 --- a/flake.nix +++ b/flake.nix @@ -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"; }; }; } -- cgit v1.2.3