调整项目结构和readme
This commit is contained in:
@@ -1,42 +0,0 @@
|
||||
args@{ self, home-manager, username, version, ... }: {
|
||||
|
||||
# You can import other NixOS modules here
|
||||
imports = [
|
||||
# If you want to use modules your own flake exports (from modules/nixos):
|
||||
# outputs.nixosModules.example
|
||||
|
||||
# Or modules from other flakes (such as nixos-hardware):
|
||||
# inputs.hardware.nixosModules.common-cpu-amd
|
||||
# inputs.hardware.nixosModules.common-ssd
|
||||
|
||||
# You can also split up your configuration and import pieces of it here:
|
||||
# ./users.nix
|
||||
|
||||
# Import your generated (nixos-generate-config) hardware configuration
|
||||
./network.nix
|
||||
./hardware-configuration.nix
|
||||
|
||||
"${self}/modules/nixos/core"
|
||||
"${self}/modules/nixos/user.nix"
|
||||
"${self}/modules/nixos/sysatomic.nix"
|
||||
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
# home-manager.useGlobalPkgs = true;
|
||||
# home-manager.useUserPackages = true;
|
||||
home-manager = {
|
||||
extraSpecialArgs = {
|
||||
inherit (args) self inputs outputs libs sourcepath hostname username useremail version;
|
||||
};
|
||||
users."${username}" = { ... }: {
|
||||
imports = [
|
||||
"${self}/home/desktop.nix"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
];
|
||||
|
||||
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
|
||||
system.stateVersion = version;
|
||||
}
|
||||
@@ -2,11 +2,54 @@ args@{ libs, inputs, nixos, ... }:
|
||||
let
|
||||
# 使用pkgs.unstable中的nixpkgs和home-manager
|
||||
inherit (nixos.unstable) nixpkgs home-manager version;
|
||||
sysArgs = args // { inherit home-manager version; };
|
||||
specialArgs = args // { inherit home-manager version; };
|
||||
|
||||
configuration = conf-args@{ self, home-manager, username, version, ... }: {
|
||||
# You can import other NixOS modules here
|
||||
imports = [
|
||||
# If you want to use modules your own flake exports (from modules/nixos):
|
||||
# outputs.nixosModules.example
|
||||
|
||||
# Or modules from other flakes (such as nixos-hardware):
|
||||
# inputs.hardware.nixosModules.common-cpu-amd
|
||||
# inputs.hardware.nixosModules.common-ssd
|
||||
|
||||
# You can also split up your configuration and import pieces of it here:
|
||||
# ./users.nix
|
||||
|
||||
# Import your generated (nixos-generate-config) hardware configuration
|
||||
./network.nix
|
||||
./hardware-configuration.nix
|
||||
|
||||
"${self}/modules/nixos/core"
|
||||
"${self}/modules/nixos/user.nix"
|
||||
"${self}/modules/nixos/sysatomic.nix"
|
||||
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
# home-manager.useGlobalPkgs = true;
|
||||
# home-manager.useUserPackages = true;
|
||||
home-manager = {
|
||||
extraSpecialArgs = {
|
||||
inherit (conf-args) self inputs outputs libs sourcepath hostname username useremail version;
|
||||
};
|
||||
users."${username}" = { ... }: {
|
||||
imports = [
|
||||
"${self}/home/desktop.nix"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
];
|
||||
|
||||
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
|
||||
system.stateVersion = version;
|
||||
};
|
||||
|
||||
in
|
||||
# 使用libs.mkNixosSystem创建nixosSystem
|
||||
libs.mkNixosSystem {
|
||||
inherit nixpkgs;
|
||||
args = sysArgs;
|
||||
path = ./.;
|
||||
nixpkgs.lib.nixosSystem {
|
||||
inherit specialArgs;
|
||||
modules = [
|
||||
configuration
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user