-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Rafiyq Widianto
committed
Sep 17, 2020
1 parent
a8d85ab
commit 8f87392
Showing
4 changed files
with
93 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
{ | ||
description = "NixOS configuration"; | ||
|
||
inputs = { | ||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-20.03"; | ||
unstable.url = "github:nixos/nixpkgs/nixos-unstable"; | ||
home-manager.url = "github:rycee/home-manager"; | ||
emacs.url = "github:nix-community/emacs-overlay"; | ||
hardware.url = "github:NixOS/nixos-hardware"; | ||
}; | ||
|
||
outputs = inputs: { | ||
nixosConfigurations.nixos = { | ||
hostname = let | ||
system = "x86_64-linux"; | ||
pkgs = inputs.nixpkgs.legacyPackages.${system}; | ||
inherit (inputs.nixpkgs) lib; | ||
|
||
# Things in this set are passed to modules and accessible | ||
# in the top-level arguments (e.g. `{ pkgs, lib, inputs, ... }:`). | ||
specialArgs = { | ||
inherit inputs; | ||
}; | ||
|
||
hm-nixos-as-super = { config, ... }: { | ||
# Submodules have merge semantics, making it possible to amend | ||
# the `home-manager.users` submodule for additional functionality. | ||
options.home-manager.users = lib.mkOption { | ||
type = lib.types.attrsOf (lib.types.submoduleWith { | ||
modules = [ ]; | ||
# Makes specialArgs available to Home Manager modules as well. | ||
specialArgs = specialArgs // { | ||
# Allow accessing the parent NixOS configuration. | ||
super = config; | ||
}; | ||
}); | ||
}; | ||
}; | ||
|
||
modules = [ | ||
{ | ||
nixpkgs.overlays = [ inputs.emacs.overlay ]; | ||
#system.configurationRevision = | ||
# if self ? rev | ||
# then self.rev | ||
# else throw "Refusing to build from a dirty Git tree!"; | ||
} | ||
|
||
inputs.hardware.nixosModules.lenovo-thinkpad-x220 | ||
(import ./hosts/nixos) | ||
|
||
inputs.home.nixosModules.home-manager | ||
(import ./modules/core.nix) | ||
|
||
inputs.nixpkgs.nixosModules.notDetected | ||
hm-nixos-as-super | ||
]; | ||
in lib.nixosSystem { inherit system modules specialArgs; }; | ||
}; | ||
}; | ||
} |
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,34 @@ | ||
{ | ||
description = "NixOS configuration"; | ||
|
||
inputs = { | ||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-20.03"; | ||
unstable.url = "github:nixos/nixpkgs/nixos-unstable"; | ||
home-manager.url = "github:rycee/home-manager"; | ||
home.url = "github:rycee/home-manager"; | ||
emacs.url = "github:nix-community/emacs-overlay"; | ||
hardware.url = "github:NixOS/nixos-hardware"; | ||
}; | ||
|
||
outputs = inputs: { | ||
nixosConfigurations = { | ||
hostname = let | ||
system = "x86_64-linux"; | ||
pkgs = inputs.nixpkgs.legacyPackages.${system}; | ||
inherit (inputs.nixpkgs) lib; | ||
|
||
# Things in this set are passed to modules and accessible | ||
# in the top-level arguments (e.g. `{ pkgs, lib, inputs, ... }:`). | ||
specialArgs = { | ||
inherit inputs; | ||
}; | ||
|
||
hm-nixos-as-super = { config, ... }: { | ||
# Submodules have merge semantics, making it possible to amend | ||
# the `home-manager.users` submodule for additional functionality. | ||
options.home-manager.users = lib.mkOption { | ||
type = lib.types.attrsOf (lib.types.submoduleWith { | ||
modules = [ ]; | ||
# Makes specialArgs available to Home Manager modules as well. | ||
specialArgs = specialArgs // { | ||
# Allow accessing the parent NixOS configuration. | ||
super = config; | ||
}; | ||
}); | ||
}; | ||
}; | ||
|
||
modules = [ | ||
{ | ||
nixpkgs.overlays = [ inputs.emacs.overlay ]; | ||
system.configurationRevision = | ||
if self ? rev | ||
then self.rev | ||
else throw "Refusing to build from a dirty Git tree!"; | ||
} | ||
|
||
inputs.hardware.nixosModules.lenovo-thinkpad-x220 | ||
(import ./hosts/nixos) | ||
|
||
inputs.home.nixosModules.home-manager | ||
(import ./modules/core.nix) | ||
|
||
inputs.nixpkgs.nixosModules.notDetected | ||
hm-nixos-as-super | ||
]; | ||
in lib.nixosSystem { inherit system modules specialArgs; }; | ||
outputs = { self, nix, ... }@inputs: { | ||
nixosConfigurations.nixos = inputs.nixpkgs.lib.nixosSystem { | ||
system = "x86_64-linux"; | ||
modules = [ | ||
{ | ||
nixpkgs.overlays = [ inputs.emacs.overlay ]; | ||
system.configurationRevision = | ||
if self ? rev | ||
then self.rev | ||
else throw "Refusing to build from a dirty Git tree!"; | ||
} | ||
|
||
inputs.hardware.nixosModules.lenovo-thinkpad-x220 | ||
(import ./hosts/nixos) | ||
|
||
inputs.home.nixosModules.home-manager | ||
(import ./modules/core.nix) | ||
|
||
inputs.nixpkgs.nixosModules.notDetected | ||
]; | ||
specialArgs = { inherit inputs; }; | ||
}; | ||
nixos = inputs.self.nixosConfigurations.nixos.config.system.build.toplevel; | ||
}; | ||
} |