started reformatting and added formatter

This commit is contained in:
Jakub Kropáček 2024-09-19 17:44:40 +02:00
parent 77e9e90c6d
commit c6e3daefbf
10 changed files with 243 additions and 164 deletions

View file

@ -8,29 +8,32 @@
nix-flatpak.url = "github:gmodena/nix-flatpak"; nix-flatpak.url = "github:gmodena/nix-flatpak";
home-manager = { home-manager = {
url = "github:nix-community/home-manager"; url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
}; };
outputs = inputs@{ self, nixpkgs, ... }: { outputs =
# Please replace my-nixos with your hostname inputs@{ self, nixpkgs, ... }:
nixosConfigurations = { {
# Please replace my-nixos with your hostname
nixosConfigurations = {
work-ntb = nixpkgs.lib.nixosSystem { work-ntb = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
modules = [ modules = [
./nixosModules ./nixosModules
./hosts/work-ntb ./hosts/work-ntb
inputs.nix-flatpak.nixosModules.nix-flatpak inputs.nix-flatpak.nixosModules.nix-flatpak
inputs.home-manager.nixosModules.home-manager inputs.home-manager.nixosModules.home-manager
]; ];
specialArgs = { specialArgs = {
hostname = "work-ntb"; hostname = "work-ntb";
}; };
};
extraSpecialArgs = {
inherit inputs;
};
}; };
extraSpecialArgs = {
inherit inputs;
};
};
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt-rfc-style;
}; };
} }

View file

@ -2,13 +2,18 @@
# your system. Help is available in the configuration.nix(5) man page # your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help). # and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, hostname, ... }: {
config,
pkgs,
hostname,
...
}:
{ {
imports = imports = [
[ # Include the results of the hardware scan. # Include the results of the hardware scan.
../${hostname}/hardware-configuration.nix ../${hostname}/hardware-configuration.nix
]; ];
# Bootloader. # Bootloader.
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
@ -68,8 +73,8 @@
# Enable CUPS to print documents. # Enable CUPS to print documents.
services.printing = { services.printing = {
enable = true; enable = true;
drivers = [ pkgs.samsung-unified-linux-driver ]; drivers = [ pkgs.samsung-unified-linux-driver ];
}; };
# Enable sound with pipewire. # Enable sound with pipewire.
@ -95,17 +100,21 @@
users.users.krop = { users.users.krop = {
isNormalUser = true; isNormalUser = true;
description = "Jakub Kropacek"; description = "Jakub Kropacek";
extraGroups = [ "networkmanager" "wheel" ]; extraGroups = [
"networkmanager"
"wheel"
];
shell = pkgs.zsh; shell = pkgs.zsh;
}; };
# Allow unfree packages # Allow unfree packages
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
# Enable flakes # Enable flakes
nix.settings.experimental-features = [ "nix-command" "flakes" ]; nix.settings.experimental-features = [
"nix-command"
"flakes"
];
# List packages installed in system profile. To search, run: # List packages installed in system profile. To search, run:
# $ nix search wget # $ nix search wget
@ -120,13 +129,12 @@
mattermost-desktop mattermost-desktop
gh gh
gparted gparted
dig dig
prismlauncher # REMOVE AND MOVE TO games module after refactoring prismlauncher # REMOVE AND MOVE TO games module after refactoring
gnome-extension-manager # DEBUG gnome-extension-manager # DEBUG
gnomeExtensions.grand-theft-focus gnomeExtensions.grand-theft-focus
]; ];
programs = { programs = {
tmux.enable = true; tmux.enable = true;
zsh.enable = true; zsh.enable = true;
@ -141,14 +149,20 @@
services.flatpak = { services.flatpak = {
enable = true; enable = true;
remotes = [ remotes = [
{ name = "flathub"; location = "https://dl.flathub.org/repo/flathub.flatpakrepo"; } {
{ name = "flathub-beta"; location = "https://flathub.org/beta-repo/flathub-beta.flatpakrepo"; } name = "flathub";
location = "https://dl.flathub.org/repo/flathub.flatpakrepo";
}
{
name = "flathub-beta";
location = "https://flathub.org/beta-repo/flathub-beta.flatpakrepo";
}
]; ];
packages = [ packages = [
"org.gnome.World.PikaBackup" "org.gnome.World.PikaBackup"
"ca.desrt.dconf-editor" "ca.desrt.dconf-editor"
"org.onlyoffice.desktopeditors" "org.onlyoffice.desktopeditors"
"tv.kodi.Kodi" "tv.kodi.Kodi"
]; ];
}; };

View file

@ -1,21 +1,32 @@
{config, pkgs, inputs, ...}: { {
imports = [ config,
(import ../base {inherit config pkgs; hostname = "work-ntb"; }) pkgs,
]; inputs,
...
}:
{
imports = [
(import ../base {
inherit config pkgs;
hostname = "work-ntb";
})
];
# My own modules configuration # My own modules configuration
krop = { krop = {
ide = { ide = {
enable = true; enable = true;
install-pycharm = true; install-pycharm = true;
};
python.install-older = true;
}; };
python.install-older = true;
};
home-manager = { home-manager = {
extraSpecialArgs = { inherit inputs; }; extraSpecialArgs = {
users = { inherit inputs;
"krop" = import ./home.nix;
};
}; };
users = {
"krop" = import ./home.nix;
};
};
} }

View file

@ -1,28 +1,43 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }: {
config,
lib,
pkgs,
modulesPath,
...
}:
{ {
imports = imports = [
[ (modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
]; ];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; boot.initrd.availableKernelModules = [
"xhci_pci"
"ahci"
"usb_storage"
"sd_mod"
"rtsx_pci_sdmmc"
];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ]; boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" = {
{ device = "/dev/disk/by-uuid/360cfb7a-07d9-445b-83e2-6ef19bd55948"; device = "/dev/disk/by-uuid/360cfb7a-07d9-445b-83e2-6ef19bd55948";
fsType = "ext4"; fsType = "ext4";
}; };
fileSystems."/boot" = fileSystems."/boot" = {
{ device = "/dev/disk/by-uuid/5F8E-3C09"; device = "/dev/disk/by-uuid/5F8E-3C09";
fsType = "vfat"; fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ]; options = [
}; "fmask=0077"
"dmask=0077"
];
};
swapDevices = [ ]; swapDevices = [ ];

View file

@ -83,14 +83,14 @@
gtk = { gtk = {
enable = true; enable = true;
gtk3.extraConfig = { gtk3.extraConfig = {
Settings = '' Settings = ''
gtk-application-prefer-dark-theme=1 gtk-application-prefer-dark-theme=1
''; '';
}; };
gtk4.extraConfig = { gtk4.extraConfig = {
Settings = '' Settings = ''
gtk-application-prefer-dark-theme=1 gtk-application-prefer-dark-theme=1
''; '';
}; };
}; };
@ -100,17 +100,20 @@
style.name = "adwaita-dark"; style.name = "adwaita-dark";
}; };
programs.git = { programs.git = {
enable = true; enable = true;
userName = "Jakub Kropáček"; userName = "Jakub Kropáček";
userEmail = "kropikuba@gmail.com"; userEmail = "kropikuba@gmail.com";
includes = let workcfg = { includes =
user = { let
email = "jakub.kropacek@olc.cz"; workcfg = {
name = "Jakub Kropáček"; user = {
}; email = "jakub.kropacek@olc.cz";
}; in [ name = "Jakub Kropáček";
};
};
in
[
{ {
condition = "gitdir:~/Repositories/OLC/**"; condition = "gitdir:~/Repositories/OLC/**";
contents = workcfg; contents = workcfg;
@ -119,23 +122,23 @@
condition = "gitdir:~/Repositories/OLC-Hexpol/**"; condition = "gitdir:~/Repositories/OLC-Hexpol/**";
contents = workcfg; contents = workcfg;
} }
]; ];
extraConfig = { extraConfig = {
init = { init = {
defaultBranch = "master"; defaultBranch = "master";
}; };
push = { push = {
autoSetupRemote = true; autoSetupRemote = true;
}; };
status = { status = {
submoduleSummary = true; submoduleSummary = true;
}; };
diff = { diff = {
submodule = "log"; submodule = "log";
}; };
core = { core = {
autocrlf = "input"; autocrlf = "input";
}; };
}; };
}; };

View file

@ -1,6 +1,6 @@
{...}: { ... }:
{ {
imports = [ imports = [
./dev ./dev
]; ];
} }

View file

@ -1,29 +1,37 @@
{ config, pkgs, lib, ... }@inputs: {
config,
pkgs,
lib,
...
}@inputs:
let let
cfg = config.krop.devtools; cfg = config.krop.devtools;
in { in
imports = [ {
./python.nix imports = [
./ide.nix ./python.nix
]; ./ide.nix
options.krop.devtools = { ];
installTools = lib.mkOption { options.krop.devtools = {
type = lib.types.bool; installTools = lib.mkOption {
default = true; type = lib.types.bool;
example = true; default = true;
description = "Whether to install the most used tools"; example = true;
}; description = "Whether to install the most used tools";
}; };
};
config = let config =
tools = with pkgs; [ let
lazygit tools = with pkgs; [
lazydocker lazygit
micro-with-wl-clipboard lazydocker
albert micro-with-wl-clipboard
openssl_3_3 albert
]; openssl_3_3
in { ];
environment.systemPackages = tools; in
{
environment.systemPackages = tools;
}; };
} }

View file

@ -0,0 +1,4 @@
{
...
}:
{ }

View file

@ -1,23 +1,32 @@
{ config, pkgs, lib, ... }: {
config,
pkgs,
lib,
...
}:
let let
cfg = config.krop.ide; cfg = config.krop.ide;
in { in
options.krop.ide = { {
enable = lib.mkOption { options.krop.ide = {
type = lib.types.bool; enable = lib.mkOption {
default = lib.mkOptionDefault true; type = lib.types.bool;
example = true; default = true;
}; example = true;
install-pycharm = lib.mkOption {
type = lib.types.bool;
default = lib.mkOptionDefault false;
example = true;
};
};
config = lib.mkIf cfg.enable {
environment.systemPackages = with pkgs; [
zed-editor
vscodium
] ++ lib.optionals cfg.install-pycharm [pkgs.jetbrains.pycharm-professional];
}; };
} install-pycharm = lib.mkOption {
type = lib.types.bool;
default = false;
example = true;
};
};
config = lib.mkIf cfg.enable {
environment.systemPackages =
with pkgs;
[
zed-editor
vscodium
]
++ lib.optionals cfg.install-pycharm [ pkgs.jetbrains.pycharm-professional ];
};
}

View file

@ -1,24 +1,36 @@
{ config, pkgs, lib, ... }: {
config,
pkgs,
lib,
...
}:
let let
cfg = config.krop.python; cfg = config.krop.python;
in { in
options.krop.python = { {
enable = lib.mkOption { options.krop.python = {
type = lib.types.bool; enable = lib.mkOption {
default = lib.mkOptionDefault false; type = lib.types.bool;
example = true; default = false;
}; example = true;
install-older = lib.mkOption {
type = lib.types.bool;
default = lib.mkOptionDefault true;
example = true;
};
};
config = lib.mkIf cfg.enable {
environment.systemPackages = with pkgs; [
python3
poetry
] ++ lib.optionals cfg.install-older [python311 python310];
}; };
} install-older = lib.mkOption {
type = lib.types.bool;
default = true;
example = true;
};
};
config = lib.mkIf cfg.enable {
environment.systemPackages =
with pkgs;
[
python3
poetry
]
++ lib.optionals cfg.install-older [
python311
python310
];
};
}