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";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs@{ self, nixpkgs, ... }: {
# Please replace my-nixos with your hostname
nixosConfigurations = {
outputs =
inputs@{ self, nixpkgs, ... }:
{
# Please replace my-nixos with your hostname
nixosConfigurations = {
work-ntb = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./nixosModules
./hosts/work-ntb
inputs.nix-flatpak.nixosModules.nix-flatpak
inputs.home-manager.nixosModules.home-manager
];
specialArgs = {
hostname = "work-ntb";
};
};
extraSpecialArgs = {
inherit inputs;
};
system = "x86_64-linux";
modules = [
./nixosModules
./hosts/work-ntb
inputs.nix-flatpak.nixosModules.nix-flatpak
inputs.home-manager.nixosModules.home-manager
];
specialArgs = {
hostname = "work-ntb";
};
};
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
# and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, hostname, ... }:
{
config,
pkgs,
hostname,
...
}:
{
imports =
[ # Include the results of the hardware scan.
../${hostname}/hardware-configuration.nix
];
imports = [
# Include the results of the hardware scan.
../${hostname}/hardware-configuration.nix
];
# Bootloader.
boot.loader.systemd-boot.enable = true;
@ -68,8 +73,8 @@
# Enable CUPS to print documents.
services.printing = {
enable = true;
drivers = [ pkgs.samsung-unified-linux-driver ];
enable = true;
drivers = [ pkgs.samsung-unified-linux-driver ];
};
# Enable sound with pipewire.
@ -95,17 +100,21 @@
users.users.krop = {
isNormalUser = true;
description = "Jakub Kropacek";
extraGroups = [ "networkmanager" "wheel" ];
extraGroups = [
"networkmanager"
"wheel"
];
shell = pkgs.zsh;
};
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
# 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:
# $ nix search wget
@ -120,13 +129,12 @@
mattermost-desktop
gh
gparted
dig
dig
prismlauncher # REMOVE AND MOVE TO games module after refactoring
gnome-extension-manager # DEBUG
gnomeExtensions.grand-theft-focus
];
programs = {
tmux.enable = true;
zsh.enable = true;
@ -141,14 +149,20 @@
services.flatpak = {
enable = true;
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 = [
"org.gnome.World.PikaBackup"
"ca.desrt.dconf-editor"
"org.onlyoffice.desktopeditors"
"tv.kodi.Kodi"
"org.gnome.World.PikaBackup"
"ca.desrt.dconf-editor"
"org.onlyoffice.desktopeditors"
"tv.kodi.Kodi"
];
};

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,23 +1,32 @@
{ config, pkgs, lib, ... }:
{
config,
pkgs,
lib,
...
}:
let
cfg = config.krop.ide;
in {
options.krop.ide = {
enable = lib.mkOption {
type = lib.types.bool;
default = lib.mkOptionDefault 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];
cfg = config.krop.ide;
in
{
options.krop.ide = {
enable = lib.mkOption {
type = lib.types.bool;
default = true;
example = true;
};
}
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
cfg = config.krop.python;
in {
options.krop.python = {
enable = lib.mkOption {
type = lib.types.bool;
default = lib.mkOptionDefault 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];
cfg = config.krop.python;
in
{
options.krop.python = {
enable = lib.mkOption {
type = lib.types.bool;
default = false;
example = true;
};
}
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
];
};
}