调整项目结构和readme
This commit is contained in:
@@ -1,52 +0,0 @@
|
||||
args@{ self, pkgs, 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
|
||||
|
||||
# Import your generated (nixos-generate-config) hardware configuration
|
||||
./mount.nix
|
||||
./network.nix
|
||||
./hardware-configuration.nix
|
||||
|
||||
"${self}/modules/nixos/core"
|
||||
"${self}/modules/nixos/fonts"
|
||||
"${self}/modules/nixos/user.nix"
|
||||
"${self}/modules/nixos/audio.nix"
|
||||
"${self}/modules/nixos/nvidia.nix"
|
||||
"${self}/modules/nixos/samba.nix"
|
||||
"${self}/modules/nixos/zfs.nix"
|
||||
"${self}/modules/nixos/sysatomic.nix"
|
||||
|
||||
"${self}/modules/nixos/virtualize/libvirtd"
|
||||
"${self}/modules/nixos/virtualize/docker.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 = [
|
||||
./hm
|
||||
"${self}/home/desktop.nix"
|
||||
"${self}/modules/home/develop.nix"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
];
|
||||
|
||||
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
|
||||
system.stateVersion = version;
|
||||
}
|
||||
@@ -1,12 +1,29 @@
|
||||
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, ... }: {
|
||||
imports = [
|
||||
./nixos
|
||||
|
||||
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}" = ./home;
|
||||
};
|
||||
}
|
||||
];
|
||||
|
||||
};
|
||||
in
|
||||
# 使用libs.mkNixosSystem创建nixosSystem
|
||||
libs.mkNixosSystem {
|
||||
inherit nixpkgs;
|
||||
args = sysArgs;
|
||||
path = ./.;
|
||||
nixpkgs.lib.nixosSystem {
|
||||
inherit specialArgs;
|
||||
modules = [
|
||||
configuration
|
||||
];
|
||||
}
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
{ ... }: {
|
||||
imports = [
|
||||
./ssh.nix
|
||||
./hyprland.nix
|
||||
];
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
{ config, ... }:
|
||||
{
|
||||
programs.ssh = {
|
||||
enable = true;
|
||||
|
||||
# 全局 SSH 配置
|
||||
extraConfig = ''
|
||||
Host apollo
|
||||
HostName 10.7.43.10
|
||||
|
||||
Host zion
|
||||
HostName 10.7.43.1
|
||||
User root
|
||||
|
||||
Host themis
|
||||
HostName 10.7.43.30
|
||||
|
||||
Host armor
|
||||
HostName armor.synebula.com
|
||||
|
||||
Host server.company
|
||||
HostName file.xzdcbj.com.cn
|
||||
User xzdc
|
||||
Port 57982
|
||||
|
||||
Host server.info
|
||||
HostName info.xzdcbj.com.cn
|
||||
User info
|
||||
|
||||
Host server.file
|
||||
HostName file.xzdcbj.com.cn
|
||||
User file
|
||||
|
||||
Host server.armor
|
||||
HostName armor.synebula.com
|
||||
|
||||
Host ems.hc
|
||||
Port 57991
|
||||
User root
|
||||
|
||||
Host ems.cx
|
||||
Port 57996
|
||||
|
||||
Host ems.ph
|
||||
Port 57996
|
||||
|
||||
Host ems.yt
|
||||
Port 57996
|
||||
User xzdc
|
||||
|
||||
Host ems.*
|
||||
HostName file.xzdcbj.com.cn
|
||||
User ems
|
||||
|
||||
Host *
|
||||
Port 22
|
||||
User alex
|
||||
IdentityFile ~/.ssh/id_rsa
|
||||
'';
|
||||
};
|
||||
}
|
||||
12
profiles/gaea/home/default.nix
Normal file
12
profiles/gaea/home/default.nix
Normal file
@@ -0,0 +1,12 @@
|
||||
{ self, pkgs, ... }: {
|
||||
imports = [
|
||||
./ssh
|
||||
"${self}/home/desktop.nix"
|
||||
"${self}/modules/home/develop.nix"
|
||||
];
|
||||
|
||||
home.packages = with pkgs; [
|
||||
nextcloud-client
|
||||
kodi
|
||||
];
|
||||
}
|
||||
@@ -5,11 +5,8 @@
|
||||
sessionVariables = {
|
||||
# for hyprland with nvidia gpu, ref https://wiki.hyprland.org/Nvidia/
|
||||
# 启用注释部分会导致NVIDIA下无法启动hyprland
|
||||
LIBVA_DRIVER_NAME = "nvidia";
|
||||
__GLX_VENDOR_LIBRARY_NAME = "nvidia";
|
||||
|
||||
# WLR_RENDERER = "vulkan";
|
||||
# GBM_BACKEND = "nvidia-drm";
|
||||
WLR_DRM_DEVICES = "/dev/dri/card1";
|
||||
AQ_DRM_DEVICES = "/dev/dri/card1";
|
||||
};
|
||||
};
|
||||
}
|
||||
64
profiles/gaea/home/ssh/config
Normal file
64
profiles/gaea/home/ssh/config
Normal file
@@ -0,0 +1,64 @@
|
||||
|
||||
Host *
|
||||
ForwardAgent no
|
||||
AddKeysToAgent no
|
||||
Compression no
|
||||
ServerAliveInterval 0
|
||||
ServerAliveCountMax 3
|
||||
HashKnownHosts no
|
||||
UserKnownHostsFile ~/.ssh/known_hosts
|
||||
ControlMaster no
|
||||
ControlPath ~/.ssh/master-%r@%n:%p
|
||||
ControlPersist no
|
||||
|
||||
Host apollo
|
||||
HostName 10.7.43.10
|
||||
|
||||
Host zion
|
||||
HostName 10.7.43.1
|
||||
User root
|
||||
|
||||
Host themis
|
||||
HostName 10.7.43.30
|
||||
|
||||
Host armor
|
||||
HostName armor.synebula.com
|
||||
|
||||
Host server.company
|
||||
HostName file.xzdcbj.com.cn
|
||||
User xzdc
|
||||
Port 57982
|
||||
|
||||
Host server.info
|
||||
HostName info.xzdcbj.com.cn
|
||||
User info
|
||||
|
||||
Host server.file
|
||||
HostName file.xzdcbj.com.cn
|
||||
User file
|
||||
|
||||
Host server.armor
|
||||
HostName armor.synebula.com
|
||||
|
||||
Host ems.hc
|
||||
Port 57991
|
||||
User root
|
||||
|
||||
Host ems.cx
|
||||
Port 57996
|
||||
|
||||
Host ems.ph
|
||||
Port 57996
|
||||
|
||||
Host ems.yt
|
||||
Port 57996
|
||||
User xzdc
|
||||
|
||||
Host ems.*
|
||||
HostName file.xzdcbj.com.cn
|
||||
User ems
|
||||
|
||||
Host *
|
||||
Port 22
|
||||
User alex
|
||||
IdentityFile ~/.ssh/id_rsa
|
||||
9
profiles/gaea/home/ssh/default.nix
Normal file
9
profiles/gaea/home/ssh/default.nix
Normal file
@@ -0,0 +1,9 @@
|
||||
{ config, flakesPath, ... }: {
|
||||
programs.ssh = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
home.file.".ssh/config" = {
|
||||
source = config.home-libs.mkOutOfStoreSymlink "profiles/apollo/hm/ssh/config";
|
||||
};
|
||||
}
|
||||
22
profiles/gaea/nixos/default.nix
Normal file
22
profiles/gaea/nixos/default.nix
Normal file
@@ -0,0 +1,22 @@
|
||||
{ self, pkgs, version, ... }: {
|
||||
imports = [
|
||||
./mount.nix
|
||||
./network.nix
|
||||
./hardware-configuration.nix
|
||||
|
||||
"${self}/modules/nixos/core"
|
||||
"${self}/modules/nixos/fonts"
|
||||
"${self}/modules/nixos/user.nix"
|
||||
"${self}/modules/nixos/audio.nix"
|
||||
"${self}/modules/nixos/nvidia.nix"
|
||||
"${self}/modules/nixos/samba.nix"
|
||||
"${self}/modules/nixos/zfs.nix"
|
||||
"${self}/modules/nixos/sysatomic.nix"
|
||||
|
||||
"${self}/modules/nixos/virtualize/libvirtd"
|
||||
"${self}/modules/nixos/virtualize/docker.nix"
|
||||
];
|
||||
|
||||
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
|
||||
system.stateVersion = version;
|
||||
}
|
||||
Reference in New Issue
Block a user