feat(nixos): add initial NixOS and Home Manager configuration
This commit is contained in:
Generated
+134
@@ -0,0 +1,134 @@
|
|||||||
|
{
|
||||||
|
"nodes": {
|
||||||
|
"flake-parts": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs-lib": "nixpkgs-lib"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1782949081,
|
||||||
|
"narHash": "sha256-vp6Y/Grm98ESt6ceOkWiHWyZRDV3J1RID4w+6NWK9yA=",
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "flake-parts",
|
||||||
|
"rev": "17c9d6cdfc60c64f4ee8d306f9bc0b4ccb51481e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "flake-parts",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"home-manager": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1783221248,
|
||||||
|
"narHash": "sha256-ESQnuNHEDChsB4IxoLRhscVahqkDWkTb+qdIz8euYt4=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "home-manager",
|
||||||
|
"rev": "af2beae5f0fae0a4310cc0e6aef2572f56090353",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"ref": "release-26.05",
|
||||||
|
"repo": "home-manager",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"import-tree": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1778781969,
|
||||||
|
"narHash": "sha256-Jjuz5CmSkur8KvLDoGa+vylEp+RkQtv4mt/qcMznpH0=",
|
||||||
|
"owner": "vic",
|
||||||
|
"repo": "import-tree",
|
||||||
|
"rev": "d321337efd0f23a9eb14a42adb7b2c29313ab274",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "vic",
|
||||||
|
"repo": "import-tree",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1783389287,
|
||||||
|
"narHash": "sha256-0xIy4dVLqq47rA+mRy0hXDfjhQd4E5PoIns/RmB7nR4=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "0ad6f47ea4fe188f4bc8f0380f93ae8523337c6c",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixos-26.05",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs-lib": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1782614948,
|
||||||
|
"narHash": "sha256-ePjCwr1sNm9NYUqywL7QfK3JnlS015msC+eBu2zKlp8=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "nixpkgs.lib",
|
||||||
|
"rev": "db3f255737b94216eb71cce308e2912cf6bc2d7c",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "nixpkgs.lib",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs_2": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1780336545,
|
||||||
|
"narHash": "sha256-vhVhuXzFrIOfcssC/9hDHx7MHzDKjF3keHuREOQqQiQ=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "4df1b885d76a54e1aa1a318f8d16fd6005b6401f",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixpkgs-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-parts": "flake-parts",
|
||||||
|
"home-manager": "home-manager",
|
||||||
|
"import-tree": "import-tree",
|
||||||
|
"nixpkgs": "nixpkgs",
|
||||||
|
"wrapper-modules": "wrapper-modules"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"wrapper-modules": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": "nixpkgs_2"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1782135443,
|
||||||
|
"narHash": "sha256-vAmbArdCyjqpVW+37aCy/PMBOLIqukUXLQuEKLwUhA4=",
|
||||||
|
"owner": "BirdeeHub",
|
||||||
|
"repo": "nix-wrapper-modules",
|
||||||
|
"rev": "6e7f66fa2cdf4d63162580b438f7fcf87c28a46f",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "BirdeeHub",
|
||||||
|
"repo": "nix-wrapper-modules",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": "root",
|
||||||
|
"version": 7
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
{
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-26.05";
|
||||||
|
|
||||||
|
home-manager = {
|
||||||
|
url = "github:nix-community/home-manager/release-26.05";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
|
||||||
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||||
|
|
||||||
|
import-tree.url = "github:vic/import-tree";
|
||||||
|
|
||||||
|
wrapper-modules.url = "github:BirdeeHub/nix-wrapper-modules";
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs = inputs@{ flake-parts, import-tree, home-manager, ... }:
|
||||||
|
let
|
||||||
|
mkFlake = flake-parts.lib.mkFlake;
|
||||||
|
|
||||||
|
flakeArgs = {
|
||||||
|
inherit inputs;
|
||||||
|
};
|
||||||
|
|
||||||
|
flakeConfig = {
|
||||||
|
imports = [
|
||||||
|
home-manager.flakeModules.home-manager
|
||||||
|
(import-tree ./modules)
|
||||||
|
];
|
||||||
|
|
||||||
|
systems = [
|
||||||
|
"x86_64-linux"
|
||||||
|
"aarch64-linux"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
in
|
||||||
|
mkFlake flakeArgs flakeConfig;
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
{ self, withSystem, inputs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
flake.homeConfigurations.user =
|
||||||
|
withSystem "x86_64-linux" ({ pkgs, ... }:
|
||||||
|
inputs.home-manager.lib.homeManagerConfiguration {
|
||||||
|
inherit pkgs;
|
||||||
|
|
||||||
|
modules = with self.homeModules; [
|
||||||
|
bash
|
||||||
|
cursor
|
||||||
|
kitty
|
||||||
|
|
||||||
|
{
|
||||||
|
home.username = "user";
|
||||||
|
home.homeDirectory = "/home/user";
|
||||||
|
home.stateVersion = "26.05";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
{ self, inputs, ... }: {
|
||||||
|
flake.nixosModules.niri = { pkgs, lib, ... }: {
|
||||||
|
programs.niri = {
|
||||||
|
enable = true;
|
||||||
|
package = self.packages.${pkgs.stdenv.hostPlatform.system}.myNiri;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
perSystem = { pkgs, lib, self', ... }: {
|
||||||
|
packages.myNiri = inputs.wrapper-modules.wrappers.niri.wrap {
|
||||||
|
inherit pkgs;
|
||||||
|
settings = {
|
||||||
|
spawn-at-startup = [
|
||||||
|
(lib.getExe self'.packages.myNoctalia)
|
||||||
|
];
|
||||||
|
|
||||||
|
xwayland-satellite.path = lib.getExe pkgs.xwayland-satellite;
|
||||||
|
|
||||||
|
input.keyboard.xkb.layout = "us,ru";
|
||||||
|
|
||||||
|
layout.gaps = 5;
|
||||||
|
|
||||||
|
# binds = {
|
||||||
|
# "Mod+Return".spawn-sh = lib.getExe pkgs.kitty;
|
||||||
|
# "Mod+Q".close-window = {};
|
||||||
|
# "Mod+S".spawn-sh = "${lib.getExe self'.packages.myNoctalia} ipc call launcher toggle";
|
||||||
|
# };
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
{ self, inputs, ... }: {
|
||||||
|
perSystem = { pkgs, ... }: {
|
||||||
|
packages.myNoctalia = inputs.wrapper-modules.wrappers.noctalia-shell.wrap {
|
||||||
|
inherit pkgs;
|
||||||
|
# settings =
|
||||||
|
# (builtins.fromJSON
|
||||||
|
# (builtins.readFile ./noctalia.json)).settings;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
{ ... }: {
|
||||||
|
flake.nixosModules.sddm = { pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
sddm-astrounaut = pkgs.sddm-astronaut.override {
|
||||||
|
embeddedTheme = "astronaut";
|
||||||
|
|
||||||
|
# astronaut
|
||||||
|
# black_hole
|
||||||
|
# cyberpunk
|
||||||
|
# hyprland_kath
|
||||||
|
# jake_the_dog
|
||||||
|
# japanese_aesthetic
|
||||||
|
# japanese_aesthetic
|
||||||
|
# pixel_sakura
|
||||||
|
# pixel_sakura_static
|
||||||
|
# post-apocalyptic_hacker
|
||||||
|
# purple_leaves
|
||||||
|
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
sddm-astrounaut
|
||||||
|
];
|
||||||
|
|
||||||
|
services.displayManager.sddm = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
package = pkgs.kdePackages.sddm;
|
||||||
|
|
||||||
|
theme = "sddm-astronaut-theme";
|
||||||
|
|
||||||
|
extraPackages = with pkgs; [
|
||||||
|
kdePackages.qtmultimedia
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
services.xserver.enable = true;
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
{ self, inputs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
machine = builtins.baseNameOf ./.;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
flake.nixosModules."${machine}Configuration" = { pkgs, lib, ... }: {
|
||||||
|
imports = [
|
||||||
|
self.nixosModules."${machine}Hardware"
|
||||||
|
self.nixosModules.ssh
|
||||||
|
self.nixosModules.niri
|
||||||
|
self.nixosModules.sddm
|
||||||
|
];
|
||||||
|
|
||||||
|
nix.settings.experimental-features = [
|
||||||
|
"nix-command"
|
||||||
|
"flakes"
|
||||||
|
];
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
git
|
||||||
|
vim
|
||||||
|
wget
|
||||||
|
curl
|
||||||
|
neovim
|
||||||
|
firefox
|
||||||
|
tree
|
||||||
|
inputs.home-manager.packages.${pkgs.system}.default
|
||||||
|
];
|
||||||
|
|
||||||
|
boot = {
|
||||||
|
loader = {
|
||||||
|
systemd-boot.enable = true;
|
||||||
|
efi.canTouchEfiVariables = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
networking.hostName = "nixos-macbook-air-2017";
|
||||||
|
networking.networkmanager.enable = true;
|
||||||
|
|
||||||
|
users.users.user = {
|
||||||
|
isNormalUser = true;
|
||||||
|
extraGroups = [ "wheel" "input" "networkmanager" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
system.stateVersion = "26.05";
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
{ self, inputs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
machine = builtins.baseNameOf ./.;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
flake.nixosConfigurations.${machine} = inputs.nixpkgs.lib.nixosSystem {
|
||||||
|
modules = [
|
||||||
|
self.nixosModules."${machine}Configuration"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
{ ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
machine = builtins.baseNameOf ./.;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
flake.nixosModules."${machine}Hardware" = { config, lib, modulesPath, ... }: {
|
||||||
|
imports = [
|
||||||
|
(modulesPath + "/installer/scan/not-detected.nix")
|
||||||
|
];
|
||||||
|
|
||||||
|
boot = {
|
||||||
|
initrd = {
|
||||||
|
availableKernelModules = [
|
||||||
|
"xhci_pci"
|
||||||
|
"ahci"
|
||||||
|
"usbhid"
|
||||||
|
"usb_storage"
|
||||||
|
"sd_mod"
|
||||||
|
];
|
||||||
|
|
||||||
|
kernelModules = [ ];
|
||||||
|
};
|
||||||
|
|
||||||
|
kernelModules = [
|
||||||
|
"kvm-intel"
|
||||||
|
];
|
||||||
|
|
||||||
|
extraModulePackages = [ ];
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems = {
|
||||||
|
"/" = {
|
||||||
|
device = "/dev/disk/by-uuid/992b8f95-6ca7-475d-b3ab-54c4339619e6";
|
||||||
|
fsType = "ext4";
|
||||||
|
};
|
||||||
|
|
||||||
|
"/boot" = {
|
||||||
|
device = "/dev/disk/by-uuid/A1EC-32E5";
|
||||||
|
fsType = "vfat";
|
||||||
|
options = [
|
||||||
|
"fmask=0022"
|
||||||
|
"dmask=0022"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
swapDevices = [
|
||||||
|
{
|
||||||
|
device = "/dev/disk/by-uuid/bfb36fe8-16b4-4ea5-a8dd-0f90b5dde2fb";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
|
|
||||||
|
hardware.cpu.intel.updateMicrocode =
|
||||||
|
lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
{ ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
flake.nixosModules.ssh = { ... }: {
|
||||||
|
services.openssh = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
PasswordAuthentication = false;
|
||||||
|
PermitRootLogin = "no";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user