From 14905d43cf9548f4aab5824cc2e2128f1e576459 Mon Sep 17 00:00:00 2001 From: Chris Montgomery Date: Thu, 4 Aug 2022 11:00:34 -0400 Subject: [PATCH 1/2] hmOnly: track unstable channels --- examples/hmOnly/flake.nix | 39 ++++++++++++++++++------- examples/hmOnly/home/default.nix | 2 +- examples/hmOnly/home/users/testuser.nix | 5 +++- 3 files changed, 34 insertions(+), 12 deletions(-) diff --git a/examples/hmOnly/flake.nix b/examples/hmOnly/flake.nix index 0e30d3ebe..eecffbdd2 100644 --- a/examples/hmOnly/flake.nix +++ b/examples/hmOnly/flake.nix @@ -1,22 +1,41 @@ { - description = "A DevOS example. And also a digga test bed."; + description = "Example tracking unstable channels and libraries"; inputs = { - nixos.url = "github:nixos/nixpkgs/nixos-22.05"; - digga.url = "github:divnix/digga"; - digga.inputs.nixpkgs.follows = "nixos"; - digga.inputs.home-manager.follows = "home"; - home.url = "github:nix-community/home-manager/release-22.05"; - home.inputs.nixpkgs.follows = "nixos"; + nixos-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; + nixos-trunk.url = "github:NixOS/nixpkgs"; + nixos-stable.url = "github:NixOS/nixpkgs/nixos-22.05"; + + digga.url = "github:divnix/digga/home-manager-22.11"; + digga.inputs.nixpkgs.follows = "nixpkgs"; + digga.inputs.nixlib.follows = "nixpkgs"; + digga.inputs.home-manager.follows = "home-manager"; + + home-manager.url = "github:nix-community/home-manager"; + home-manager.inputs.nixpkgs.follows = "nixos-unstable"; + + nixpkgs.follows = "nixos-unstable"; }; - outputs = inputs @ { self, nixos, digga, home }: + outputs = { + self + , digga + , nixos-unstable + , home-manager + , nixpkgs + , ... + } @ inputs: digga.lib.mkFlake { - inherit self inputs; - channels.nixos = { }; + channels = { + nixos-unstable = {}; + nixos-stable = {}; + nixos-trunk = {}; + }; + + # FIXME: should probably not be required, but it is. nixos.hostDefaults.channelName = "nixos"; home = ./home; diff --git a/examples/hmOnly/home/default.nix b/examples/hmOnly/home/default.nix index dca6c3574..a73980d32 100644 --- a/examples/hmOnly/home/default.nix +++ b/examples/hmOnly/home/default.nix @@ -1,6 +1,6 @@ { self, inputs, ... }: let - lib = inputs.digga.lib; + inherit (inputs.digga) lib; in { imports = [ (lib.importExportableModules ./modules) ]; diff --git a/examples/hmOnly/home/users/testuser.nix b/examples/hmOnly/home/users/testuser.nix index 34e42c0a5..83b12aaa0 100644 --- a/examples/hmOnly/home/users/testuser.nix +++ b/examples/hmOnly/home/users/testuser.nix @@ -6,7 +6,10 @@ in { imports = suites.shell; - home.packages = [ pkgs.hello ]; + home.packages = with pkgs; [ + # Python packages often fail to build on unstable channels. + httpie + ]; programs.browserpass.enable = true; programs.starship.enable = true; From 3e50907e779f8c1dcd49f433e4f656704db3b1e7 Mon Sep 17 00:00:00 2001 From: Chris Montgomery Date: Thu, 4 Aug 2022 11:01:09 -0400 Subject: [PATCH 2/2] hmOnly: use `emacs-overlay` --- examples/hmOnly/flake.nix | 7 +++++++ examples/hmOnly/home/users/testuser.nix | 11 +++++++++++ 2 files changed, 18 insertions(+) diff --git a/examples/hmOnly/flake.nix b/examples/hmOnly/flake.nix index eecffbdd2..f71ad3566 100644 --- a/examples/hmOnly/flake.nix +++ b/examples/hmOnly/flake.nix @@ -14,6 +14,9 @@ home-manager.url = "github:nix-community/home-manager"; home-manager.inputs.nixpkgs.follows = "nixos-unstable"; + emacs-overlay.url = "github:nix-community/emacs-overlay"; + emacs-overlay.inputs.nixpkgs.follows = "nixpkgs"; + nixpkgs.follows = "nixos-unstable"; }; @@ -21,6 +24,7 @@ self , digga , nixos-unstable + , emacs-overlay , home-manager , nixpkgs , ... @@ -34,6 +38,9 @@ nixos-trunk = {}; }; + sharedOverlays = [ + emacs-overlay.overlay + ]; # FIXME: should probably not be required, but it is. nixos.hostDefaults.channelName = "nixos"; diff --git a/examples/hmOnly/home/users/testuser.nix b/examples/hmOnly/home/users/testuser.nix index 83b12aaa0..97f4b8773 100644 --- a/examples/hmOnly/home/users/testuser.nix +++ b/examples/hmOnly/home/users/testuser.nix @@ -7,6 +7,8 @@ in imports = suites.shell; home.packages = with pkgs; [ + # Provided by emacs-overlay + emacsPgtk # Python packages often fail to build on unstable channels. httpie ]; @@ -17,5 +19,14 @@ in userName = name; userEmail = email; }; + + programs.emacs = { + enable = true; + # While you'll probably want to use a native-comp package in the real world, + # in this example we want to avoid compilation to cut down on time/resources. + package = pkgs.emacsPgtk; + }; + + home.stateVersion = "22.11"; }