Merge branch 'main' of https://git.cyperpunk.de/DerGrumpf/cyper-nix
This commit is contained in:
123
flake.nix
123
flake.nix
@@ -34,7 +34,9 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
# declarative homebrew management
|
# declarative homebrew management
|
||||||
nix-homebrew = { url = "github:zhaofengli/nix-homebrew"; };
|
nix-homebrew = {
|
||||||
|
url = "github:zhaofengli/nix-homebrew";
|
||||||
|
};
|
||||||
|
|
||||||
# declarative Neovim
|
# declarative Neovim
|
||||||
nixvim = {
|
nixvim = {
|
||||||
@@ -67,61 +69,92 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, home-manager, darwin, nix-homebrew, nixvim
|
outputs =
|
||||||
, hyprland, sops-nix, ... }@inputs:
|
{
|
||||||
|
self,
|
||||||
|
nixpkgs,
|
||||||
|
home-manager,
|
||||||
|
darwin,
|
||||||
|
nix-homebrew,
|
||||||
|
nixvim,
|
||||||
|
hyprland,
|
||||||
|
sops-nix,
|
||||||
|
...
|
||||||
|
}@inputs:
|
||||||
let
|
let
|
||||||
primaryUser = "phil";
|
primaryUser = "phil";
|
||||||
|
mkSystem =
|
||||||
|
{
|
||||||
|
hostName,
|
||||||
|
system,
|
||||||
|
isDarwin ? false,
|
||||||
|
isServer ? false,
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
systemFunc = if isDarwin then darwin.lib.darwinSystem else nixpkgs.lib.nixosSystem;
|
||||||
|
platformModuleSet = if isDarwin then "darwinModules" else "nixosModules";
|
||||||
|
|
||||||
mkNixos = hostName:
|
sharedSpecialArgs = {
|
||||||
nixpkgs.lib.nixosSystem {
|
inherit
|
||||||
modules = [
|
inputs
|
||||||
{
|
primaryUser
|
||||||
nixpkgs.hostPlatform = "x86_64-linux";
|
self
|
||||||
networking.hostName = hostName;
|
hostName
|
||||||
}
|
isDarwin
|
||||||
./nixos
|
isServer
|
||||||
./hosts/cyper-desktop/configuration.nix
|
;
|
||||||
inputs.home-manager.nixosModules.home-manager
|
|
||||||
{
|
|
||||||
home-manager.extraSpecialArgs = {
|
|
||||||
inherit inputs primaryUser self;
|
|
||||||
isDarwin = false;
|
|
||||||
};
|
|
||||||
home-manager.users.${primaryUser} = import ./home;
|
|
||||||
}
|
|
||||||
inputs.sops-nix.nixosModules.sops
|
|
||||||
];
|
|
||||||
specialArgs = {
|
|
||||||
inherit inputs primaryUser self hostName;
|
|
||||||
isDarwin = false;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
mkDarwin = hostName:
|
sharedModules = [
|
||||||
darwin.lib.darwinSystem {
|
|
||||||
system = "x86_64-darwin";
|
|
||||||
modules = [
|
|
||||||
./darwin
|
|
||||||
./hosts/cyper-mac/configuration.nix
|
|
||||||
{ networking.hostName = hostName; }
|
{ networking.hostName = hostName; }
|
||||||
inputs.nix-homebrew.darwinModules.nix-homebrew
|
./hosts/${hostName}/configuration.nix
|
||||||
inputs.home-manager.darwinModules.home-manager
|
inputs.sops-nix.${platformModuleSet}.sops
|
||||||
|
inputs.home-manager.${platformModuleSet}.home-manager
|
||||||
{
|
{
|
||||||
home-manager.extraSpecialArgs = {
|
home-manager.extraSpecialArgs = sharedSpecialArgs;
|
||||||
inherit inputs primaryUser self;
|
|
||||||
isDarwin = true;
|
|
||||||
};
|
|
||||||
home-manager.users.${primaryUser} = import ./home;
|
home-manager.users.${primaryUser} = import ./home;
|
||||||
}
|
}
|
||||||
inputs.sops-nix.darwinModules.sops
|
|
||||||
];
|
];
|
||||||
specialArgs = {
|
|
||||||
inherit inputs primaryUser self hostName;
|
platformModules =
|
||||||
|
let
|
||||||
|
nixosBase = [
|
||||||
|
{ nixpkgs.hostPlatform = system; }
|
||||||
|
./nixos
|
||||||
|
];
|
||||||
|
in
|
||||||
|
if isDarwin then
|
||||||
|
[
|
||||||
|
./darwin
|
||||||
|
inputs.nix-homebrew.darwinModules.nix-homebrew
|
||||||
|
]
|
||||||
|
else
|
||||||
|
nixosBase ++ (if isServer then [ ./nixos/server ] else [ ]);
|
||||||
|
in
|
||||||
|
systemFunc {
|
||||||
|
inherit system;
|
||||||
|
modules = sharedModules ++ platformModules;
|
||||||
|
specialArgs = sharedSpecialArgs;
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
nixosConfigurations = {
|
||||||
|
"cyper-desktop" = mkSystem {
|
||||||
|
hostName = "cyper-desktop";
|
||||||
|
system = "x86_64-linux";
|
||||||
|
};
|
||||||
|
|
||||||
|
"cyper-node-1" = mkSystem {
|
||||||
|
hostName = "cyper-node-1";
|
||||||
|
system = "x86_64-linux";
|
||||||
|
isServer = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
darwinConfigurations."cyper-mac" = mkSystem {
|
||||||
|
hostName = "cyper-mac";
|
||||||
|
system = "x86_64-darwin";
|
||||||
isDarwin = true;
|
isDarwin = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in {
|
|
||||||
nixosConfigurations."cyper-desktop" = mkNixos "cyper-desktop";
|
|
||||||
darwinConfigurations."cyper-mac" = mkDarwin "cyper-mac";
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{ pkgs, inputs, ... }: {
|
{ pkgs, inputs, ... }:
|
||||||
|
{
|
||||||
imports = [
|
imports = [
|
||||||
inputs.catppuccin.homeModules.catppuccin
|
inputs.catppuccin.homeModules.catppuccin
|
||||||
./hyprland
|
./hyprland
|
||||||
@@ -10,7 +11,11 @@
|
|||||||
|
|
||||||
_module.args.compositor = "hyprland";
|
_module.args.compositor = "hyprland";
|
||||||
|
|
||||||
home.packages = with pkgs; [ waypaper awww ];
|
home.packages = with pkgs; [
|
||||||
|
waypaper
|
||||||
|
awww
|
||||||
|
onlyoffice-desktopeditors
|
||||||
|
];
|
||||||
home.file.".config/waypaper/config.ini".source = ./waypaper.ini;
|
home.file.".config/waypaper/config.ini".source = ./waypaper.ini;
|
||||||
|
|
||||||
programs = {
|
programs = {
|
||||||
@@ -31,5 +36,14 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
mpv.enable = true;
|
mpv.enable = true;
|
||||||
|
onlyoffice = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
UITheme = "theme-night";
|
||||||
|
appdata = "@ByteArray(eyJ1c2VybmFtZSI6InBoaWwiLCJkb2NvcGVubW9kZSI6ImVkaXQiLCJyZXN0YXJ0Ijp0cnVlLCJsYW5naWQiOiJlbi1VUyIsInVpc2NhbGluZyI6IjAiLCJ1aXRoZW1lIjoidGhlbWUtbmlnaHQiLCJlZGl0b3J3aW5kb3dtb2RlIjpmYWxzZSwic3BlbGxjaGVja2RldGVjdCI6ImF1dG8iLCJ1c2VncHUiOnRydWV9)";
|
||||||
|
editorWindowMode = false;
|
||||||
|
titlebar = "custom";
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -169,7 +169,7 @@
|
|||||||
|
|
||||||
"custom/wallpaper" = {
|
"custom/wallpaper" = {
|
||||||
format = "【{} 】";
|
format = "【{} 】";
|
||||||
exec = "basename $(swww query | grep -oP 'image: \\K.*')";
|
exec = "basename $(awww query | grep -oP 'image: \\K.*')";
|
||||||
interval = 5;
|
interval = 5;
|
||||||
on-click = "waypaper";
|
on-click = "waypaper";
|
||||||
tooltip = true;
|
tooltip = true;
|
||||||
|
|||||||
@@ -2,8 +2,11 @@
|
|||||||
{
|
{
|
||||||
programs.ssh = {
|
programs.ssh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
addKeysToAgent = "yes";
|
enableDefaultConfig = false;
|
||||||
matchBlocks = {
|
matchBlocks = {
|
||||||
|
"*" = {
|
||||||
|
addKeysToAgent = "yes";
|
||||||
|
};
|
||||||
"*.cyperpunk.de" = {
|
"*.cyperpunk.de" = {
|
||||||
identityFile =
|
identityFile =
|
||||||
if isDarwin then "/Users/${primaryUser}/.ssh/ssh" else "/home/${primaryUser}/.ssh/ssh";
|
if isDarwin then "/Users/${primaryUser}/.ssh/ssh" else "/home/${primaryUser}/.ssh/ssh";
|
||||||
|
|||||||
@@ -46,6 +46,8 @@
|
|||||||
];
|
];
|
||||||
max-jobs = "auto";
|
max-jobs = "auto";
|
||||||
cores = 0;
|
cores = 0;
|
||||||
|
http-connections = 4;
|
||||||
|
download-buffer-size = 268435456;
|
||||||
substituters = [
|
substituters = [
|
||||||
"https://cache.nixos.org"
|
"https://cache.nixos.org"
|
||||||
"https://hyprland.cachix.org"
|
"https://hyprland.cachix.org"
|
||||||
|
|||||||
Reference in New Issue
Block a user