2024-03-04 00:34:39 +03:00
|
|
|
{
|
|
|
|
inputs = {
|
|
|
|
# System.
|
|
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
2024-04-09 17:40:24 +03:00
|
|
|
stylix.url = "github:danth/stylix";
|
2024-03-04 00:34:39 +03:00
|
|
|
home-manager = {
|
|
|
|
url = "github:nix-community/home-manager";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
|
|
|
|
# Android.
|
|
|
|
nix-on-droid = {
|
|
|
|
url = "github:t184256/nix-on-droid/release-23.05";
|
2024-03-04 23:11:23 +03:00
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
inputs.home-manager.follows = "home-manager";
|
2024-03-04 00:34:39 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
# Nvim plugins.
|
|
|
|
nvimAlign = {
|
2024-04-03 07:34:36 +03:00
|
|
|
url = "github:echasnovski/mini.align";
|
2024-03-04 00:34:39 +03:00
|
|
|
flake = false;
|
|
|
|
};
|
|
|
|
nvimAutoclose = {
|
2024-04-03 07:34:36 +03:00
|
|
|
url = "github:m4xshen/autoclose.nvim";
|
2024-03-04 00:34:39 +03:00
|
|
|
flake = false;
|
|
|
|
};
|
|
|
|
nvimBufferline = {
|
2024-04-03 07:34:36 +03:00
|
|
|
url = "github:akinsho/bufferline.nvim";
|
2024-03-04 00:34:39 +03:00
|
|
|
flake = false;
|
|
|
|
};
|
|
|
|
nvimCloseBuffers = {
|
2024-04-03 07:34:36 +03:00
|
|
|
url = "github:kazhala/close-buffers.nvim";
|
2024-03-04 00:34:39 +03:00
|
|
|
flake = false;
|
|
|
|
};
|
2024-04-04 04:02:29 +03:00
|
|
|
nvimColorizer = {
|
|
|
|
url = "github:brenoprata10/nvim-highlight-colors";
|
|
|
|
flake = false;
|
|
|
|
};
|
2024-03-04 00:34:39 +03:00
|
|
|
nvimDevicons = {
|
2024-04-03 07:34:36 +03:00
|
|
|
url = "github:nvim-tree/nvim-web-devicons";
|
2024-03-04 00:34:39 +03:00
|
|
|
flake = false;
|
|
|
|
};
|
|
|
|
nvimGitsigns = {
|
2024-04-03 07:34:36 +03:00
|
|
|
url = "github:lewis6991/gitsigns.nvim";
|
2024-03-04 00:34:39 +03:00
|
|
|
flake = false;
|
|
|
|
};
|
2024-03-05 22:25:23 +03:00
|
|
|
nvimGruvboxMaterial = {
|
2024-04-03 07:34:36 +03:00
|
|
|
url = "github:sainnhe/gruvbox-material";
|
2024-03-04 00:34:39 +03:00
|
|
|
flake = false;
|
|
|
|
};
|
|
|
|
nvimIndentoMatic = {
|
2024-04-03 07:34:36 +03:00
|
|
|
url = "github:Darazaki/indent-o-matic";
|
2024-03-04 00:34:39 +03:00
|
|
|
flake = false;
|
|
|
|
};
|
|
|
|
nvimLspconfig = {
|
2024-04-03 07:34:36 +03:00
|
|
|
url = "github:neovim/nvim-lspconfig";
|
2024-03-04 00:34:39 +03:00
|
|
|
flake = false;
|
|
|
|
};
|
|
|
|
nvimOllama = {
|
2024-04-03 07:34:36 +03:00
|
|
|
url = "github:nomnivore/ollama.nvim";
|
2024-03-04 00:34:39 +03:00
|
|
|
flake = false;
|
|
|
|
};
|
|
|
|
nvimPlenary = {
|
2024-04-03 07:34:36 +03:00
|
|
|
url = "github:nvim-lua/plenary.nvim";
|
2024-03-04 00:34:39 +03:00
|
|
|
flake = false;
|
|
|
|
};
|
|
|
|
nvimSingleComment = {
|
2024-04-03 07:34:36 +03:00
|
|
|
url = "github:LucasTavaresA/singlecomment.nvim";
|
2024-03-04 00:34:39 +03:00
|
|
|
flake = false;
|
|
|
|
};
|
|
|
|
nvimTelescope = {
|
2024-04-03 07:34:36 +03:00
|
|
|
url = "github:nvim-telescope/telescope.nvim";
|
2024-03-04 00:34:39 +03:00
|
|
|
flake = false;
|
|
|
|
};
|
|
|
|
nvimTodo = {
|
2024-04-03 07:34:36 +03:00
|
|
|
url = "github:folke/todo-comments.nvim";
|
2024-03-04 00:34:39 +03:00
|
|
|
flake = false;
|
|
|
|
};
|
|
|
|
nvimTokyonight = {
|
2024-04-03 07:34:36 +03:00
|
|
|
url = "github:folke/tokyonight.nvim";
|
2024-03-04 00:34:39 +03:00
|
|
|
flake = false;
|
|
|
|
};
|
|
|
|
nvimTree = {
|
2024-04-03 07:34:36 +03:00
|
|
|
url = "github:nvim-tree/nvim-tree.lua";
|
2024-03-04 00:34:39 +03:00
|
|
|
flake = false;
|
|
|
|
};
|
|
|
|
nvimTreesitter = {
|
2024-04-03 07:34:36 +03:00
|
|
|
url = "github:nvim-treesitter/nvim-treesitter";
|
2024-03-04 00:34:39 +03:00
|
|
|
flake = false;
|
|
|
|
};
|
|
|
|
nvimTrouble = {
|
2024-04-03 07:34:36 +03:00
|
|
|
url = "github:folke/trouble.nvim";
|
2024-03-04 00:34:39 +03:00
|
|
|
flake = false;
|
|
|
|
};
|
|
|
|
nvimWhichKey = {
|
2024-04-03 07:34:36 +03:00
|
|
|
url = "github:folke/which-key.nvim";
|
2024-03-04 00:34:39 +03:00
|
|
|
flake = false;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-04-03 00:23:03 +03:00
|
|
|
outputs = { self, nixpkgs, nix-on-droid, home-manager, stylix, ... } @inputs: {
|
2024-03-04 00:34:39 +03:00
|
|
|
# Constant values.
|
2024-04-15 00:41:40 +03:00
|
|
|
const = {
|
2024-03-04 23:11:23 +03:00
|
|
|
droidStateVersion = "22.11";
|
2024-03-15 16:37:56 +03:00
|
|
|
stateVersion = "23.11";
|
2024-03-26 06:36:00 +03:00
|
|
|
timeZone = "Europe/Moscow";
|
2024-04-14 19:44:38 +03:00
|
|
|
url = "https://git.voronind.com/voronind/nixos.git";
|
2024-03-04 00:34:39 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
# Common modules used across all hosts.
|
2024-04-15 00:30:57 +03:00
|
|
|
nixosModules.common = let
|
2024-04-28 21:24:49 +03:00
|
|
|
lsFiles = path: map (f: "${path}/${f}") (
|
2024-04-15 11:28:52 +03:00
|
|
|
builtins.filter (i: builtins.readFileType "${path}/${i}" == "regular") (
|
|
|
|
builtins.attrNames (builtins.readDir path)
|
|
|
|
)
|
|
|
|
);
|
2024-04-15 00:30:57 +03:00
|
|
|
in {
|
2024-04-28 21:24:49 +03:00
|
|
|
imports = (lsFiles ./module/common) ++ (lsFiles ./overlay) ++ [ ./user/Root.nix ];
|
2024-04-15 00:30:57 +03:00
|
|
|
};
|
2024-03-04 00:34:39 +03:00
|
|
|
|
|
|
|
# Function to create a host.
|
2024-04-06 03:03:58 +03:00
|
|
|
mkHost = { system, hostname, modules } @args: nixpkgs.lib.nixosSystem {
|
2024-03-04 00:34:39 +03:00
|
|
|
inherit system;
|
|
|
|
|
|
|
|
modules = [
|
|
|
|
./host/${hostname}/Configuration.nix
|
|
|
|
{ networking.hostName = hostname; }
|
2024-04-15 00:41:40 +03:00
|
|
|
{ system.stateVersion = self.const.stateVersion; }
|
2024-03-04 00:34:39 +03:00
|
|
|
inputs.self.nixosModules.common
|
|
|
|
home-manager.nixosModules.home-manager
|
2024-04-03 00:23:03 +03:00
|
|
|
stylix.nixosModules.stylix
|
2024-03-04 00:34:39 +03:00
|
|
|
] ++ modules;
|
|
|
|
|
2024-04-06 03:03:58 +03:00
|
|
|
specialArgs = let
|
|
|
|
pkgs = nixpkgs.legacyPackages.${system}.pkgs;
|
|
|
|
config = self.nixosConfigurations.${hostname}.config;
|
|
|
|
in {
|
2024-04-15 00:41:40 +03:00
|
|
|
const = self.const;
|
2024-04-03 00:23:03 +03:00
|
|
|
flake = self;
|
|
|
|
inputs = inputs;
|
2024-04-06 03:03:58 +03:00
|
|
|
key = import ./part/Key.nix {};
|
2024-04-09 04:52:17 +03:00
|
|
|
secret = import ./part/Secret.nix {};
|
2024-04-06 03:03:58 +03:00
|
|
|
setting = import ./part/Setting.nix {};
|
|
|
|
style = import ./part/Style.nix { config = config; };
|
|
|
|
util = import ./part/Util.nix { pkgs = pkgs; };
|
|
|
|
wallpaper = import ./part/Wallpaper.nix { pkgs = pkgs; };
|
2024-03-31 22:34:21 +03:00
|
|
|
};
|
2024-03-04 00:34:39 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
# List of all hosts bellow.
|
2024-04-10 14:52:37 +03:00
|
|
|
nixosConfigurations.basic = self.mkHost {
|
|
|
|
hostname = "basic";
|
|
|
|
system = "x86_64-linux";
|
|
|
|
modules = [
|
|
|
|
({ pkgs, ... }: { boot.kernelPackages = nixpkgs.lib.mkForce pkgs.linuxPackages; })
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2024-03-04 00:34:39 +03:00
|
|
|
nixosConfigurations.dasha = self.mkHost {
|
|
|
|
hostname = "dasha";
|
|
|
|
system = "x86_64-linux";
|
|
|
|
modules = [
|
|
|
|
./module/AmdGpu.nix
|
|
|
|
./module/Gnome.nix
|
|
|
|
./module/IntelCpu.nix
|
|
|
|
./module/PowersaveIntel.nix
|
|
|
|
./module/Print.nix
|
2024-03-09 20:42:25 +03:00
|
|
|
./module/RemoteBuild.nix
|
2024-03-04 00:34:39 +03:00
|
|
|
./user/Dasha.nix
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
nixosConfigurations.desktop = self.mkHost {
|
|
|
|
hostname = "desktop";
|
|
|
|
system = "x86_64-linux";
|
|
|
|
modules = [
|
2024-03-20 22:54:40 +03:00
|
|
|
./module/AmdCompute.nix
|
2024-03-04 00:34:39 +03:00
|
|
|
./module/AmdCpu.nix
|
|
|
|
./module/AmdGpu.nix
|
2024-04-24 03:00:36 +03:00
|
|
|
# ./module/Ollama.nix
|
2024-03-04 00:34:39 +03:00
|
|
|
./module/PowersaveAmd.nix
|
|
|
|
./module/Print.nix
|
2024-03-09 20:19:48 +03:00
|
|
|
./module/RemoteBuild.nix
|
2024-03-28 08:57:07 +03:00
|
|
|
./module/Sway.nix
|
2024-03-04 00:34:39 +03:00
|
|
|
./module/VirtManager.nix
|
|
|
|
./user/Voronind.nix
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
nixosConfigurations.fsight = self.mkHost {
|
|
|
|
hostname = "fsight";
|
|
|
|
system = "x86_64-linux";
|
|
|
|
modules = [
|
|
|
|
./module/Docker.nix
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
nixosConfigurations.home = self.mkHost {
|
|
|
|
hostname = "home";
|
|
|
|
system = "x86_64-linux";
|
|
|
|
modules = [
|
|
|
|
./module/AmdCpu.nix
|
|
|
|
./module/AmdGpu.nix
|
|
|
|
./module/Docker.nix
|
|
|
|
./module/Ftpd.nix
|
2024-03-09 20:19:48 +03:00
|
|
|
./module/RemoteBuilder.nix
|
2024-03-28 08:45:55 +03:00
|
|
|
./module/Sway.nix
|
2024-03-04 00:34:39 +03:00
|
|
|
./user/Voronind.nix
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
nixosConfigurations.laptop = self.mkHost {
|
|
|
|
hostname = "laptop";
|
|
|
|
system = "x86_64-linux";
|
|
|
|
modules = [
|
|
|
|
./module/AmdCpu.nix
|
2024-03-04 21:19:30 +03:00
|
|
|
./module/AmdGpu.nix
|
2024-03-04 00:34:39 +03:00
|
|
|
./module/Gnome.nix
|
|
|
|
./module/PowersaveAmd.nix
|
|
|
|
./module/Print.nix
|
2024-03-09 20:42:25 +03:00
|
|
|
./module/RemoteBuild.nix
|
2024-03-04 00:34:39 +03:00
|
|
|
./user/Dasha.nix
|
|
|
|
./user/Voronind.nix
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
nixosConfigurations.live = self.mkHost {
|
|
|
|
hostname = "live";
|
|
|
|
system = "x86_64-linux";
|
|
|
|
modules = [
|
|
|
|
"${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix"
|
|
|
|
"${nixpkgs}/nixos/modules/installer/cd-dvd/channel.nix"
|
2024-03-10 08:04:23 +03:00
|
|
|
{ networking.wireless.enable = nixpkgs.lib.mkForce false; }
|
|
|
|
{ services.openssh.settings.PasswordAuthentication = nixpkgs.lib.mkForce true; }
|
|
|
|
{ services.openssh.settings.PermitRootLogin = nixpkgs.lib.mkForce "yes"; }
|
|
|
|
{ system.autoUpgrade.enable = nixpkgs.lib.mkForce false; }
|
|
|
|
({ pkgs, ... }: { boot.kernelPackages = nixpkgs.lib.mkForce pkgs.linuxPackages; })
|
2024-03-04 00:34:39 +03:00
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
nixosConfigurations.work = self.mkHost {
|
|
|
|
hostname = "work";
|
|
|
|
system = "x86_64-linux";
|
|
|
|
modules = [
|
|
|
|
./module/IntelCpu.nix
|
2024-04-24 03:00:36 +03:00
|
|
|
# ./module/Ollama.nix
|
2024-03-04 00:34:39 +03:00
|
|
|
./module/Powerlimit.nix
|
|
|
|
./module/PowersaveIntel.nix
|
|
|
|
./module/Print.nix
|
2024-03-09 20:42:25 +03:00
|
|
|
./module/RemoteBuild.nix
|
2024-03-28 04:27:37 +03:00
|
|
|
./module/Sway.nix
|
2024-03-04 00:34:39 +03:00
|
|
|
./user/Voronind.nix
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
# Android.
|
|
|
|
nixOnDroidConfigurations.default = nix-on-droid.lib.nixOnDroidConfiguration {
|
|
|
|
modules = [
|
2024-04-15 00:41:40 +03:00
|
|
|
{ system.stateVersion = inputs.self.const.droidStateVersion; }
|
2024-03-04 00:34:39 +03:00
|
|
|
./module/NixOnDroid.nix
|
|
|
|
];
|
2024-04-06 03:03:58 +03:00
|
|
|
|
|
|
|
extraSpecialArgs = let
|
|
|
|
pkgs = nixpkgs.legacyPackages."aarch64-linux".pkgs;
|
|
|
|
in {
|
2024-04-15 00:41:40 +03:00
|
|
|
const = self.const;
|
2024-04-06 03:03:58 +03:00
|
|
|
flake = self;
|
|
|
|
inputs = inputs;
|
|
|
|
key = import ./part/Key.nix {};
|
2024-04-09 04:52:17 +03:00
|
|
|
secret = import ./part/Secret.nix {};
|
2024-04-06 03:03:58 +03:00
|
|
|
setting = import ./part/Setting.nix {};
|
|
|
|
style = import ./part/Style.nix { config = import ./part/style/Gruvbox.nix {}; };
|
|
|
|
util = import ./part/Util.nix { pkgs = pkgs; };
|
2024-03-31 22:34:21 +03:00
|
|
|
};
|
2024-03-04 00:34:39 +03:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|