Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafiyq Widianto committed Sep 17, 2020
1 parent a8d85ab commit 8f87392
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 133 deletions.
61 changes: 61 additions & 0 deletions flake-def.nix
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; };
};
};
}
34 changes: 0 additions & 34 deletions flake-old.nix

This file was deleted.

58 changes: 9 additions & 49 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

73 changes: 23 additions & 50 deletions flake.nix
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;
};
}

0 comments on commit 8f87392

Please sign in to comment.