This commit is contained in:
Alex Davies 2024-05-31 09:28:47 -03:00
commit 36094b083a
13 changed files with 337 additions and 41 deletions

View File

@ -251,16 +251,15 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1715930644, "lastModified": 1716711219,
"narHash": "sha256-W9pyM3/vePxrffHtzlJI6lDS3seANQ+Nqp+i58O46LI=", "narHash": "sha256-TnZETiQPXbyT5mdCHMOyrJnx2+BwroMBRrguciz1vEo=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "e3ad5108f54177e6520535768ddbf1e6af54b59d", "rev": "05e6ba83eb3585ce0aff7b41e4bd0e317d05ad4a",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-community", "owner": "nix-community",
"ref": "master",
"repo": "home-manager", "repo": "home-manager",
"type": "github" "type": "github"
} }
@ -447,6 +446,29 @@
"type": "github" "type": "github"
} }
}, },
"plasma-manager": {
"inputs": {
"home-manager": [
"home-manager"
],
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1716670933,
"narHash": "sha256-E5GqDM3cPvPNyfzt1qF7T0Wei1azp1DwLF9qA0X+5M8=",
"owner": "pjones",
"repo": "plasma-manager",
"rev": "4d38fc602e01cc8d1e93e51677aade86febf3295",
"type": "github"
},
"original": {
"owner": "pjones",
"repo": "plasma-manager",
"type": "github"
}
},
"pre-commit-hooks": { "pre-commit-hooks": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_2", "flake-compat": "flake-compat_2",
@ -483,6 +505,7 @@
"nixpkgs": "nixpkgs_2", "nixpkgs": "nixpkgs_2",
"nixpkgs-unstable": "nixpkgs-unstable", "nixpkgs-unstable": "nixpkgs-unstable",
"nixvim": "nixvim", "nixvim": "nixvim",
"plasma-manager": "plasma-manager",
"ros": "ros" "ros": "ros"
} }
}, },

View File

@ -9,9 +9,18 @@
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
# Also see the 'unstable-packages' overlay at 'overlays/default.nix'. # Also see the 'unstable-packages' overlay at 'overlays/default.nix'.
# Home manager home-manager = {
home-manager.url = "github:nix-community/home-manager/master"; url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
};
nixvim.url = "github:nix-community/nixvim";
plasma-manager = {
url = "github:pjones/plasma-manager";
inputs.nixpkgs.follows = "nixpkgs";
inputs.home-manager.follows = "home-manager";
};
ros.url = "github:lopsided98/nix-ros-overlay"; ros.url = "github:lopsided98/nix-ros-overlay";
agenix.url = "github:ryantm/agenix"; agenix.url = "github:ryantm/agenix";
@ -20,7 +29,6 @@
# everything match nicely? Try nix-colors! # everything match nicely? Try nix-colors!
nix-colors.url = "github:misterio77/nix-colors"; nix-colors.url = "github:misterio77/nix-colors";
nixvim.url = "github:nix-community/nixvim";
}; };
@ -28,6 +36,8 @@
self, self,
nixpkgs, nixpkgs,
home-manager, home-manager,
nixvim,
plasma-manager,
ros, ros,
agenix, agenix,
... ...
@ -91,18 +101,19 @@
./nixos/work.nix ./nixos/work.nix
]; ];
}; };
#Thinkpad E15 Gen 3 Laptop - Type 20YG - Model 20YG003EUS #Thinkpad E15 Gen 3 Laptop (ThinkPad) - Type 20YG - Model 20YG003EUS
raziel = nixpkgs.lib.nixosSystem { ariel = nixpkgs.lib.nixosSystem {
specialArgs = { specialArgs = {
inherit inputs outputs; inherit inputs outputs;
hostname = "raziel"; hostname = "ariel";
}; };
modules = [ modules = [
./nixos/configuration.nix ./nixos/configuration.nix
./nixos/kde-desktop.nix ./nixos/kde-desktop.nix
./nixos/cad.nix
./nixos/zerotier.nix ./nixos/zerotier.nix
./nixos/work.nix ./nixos/work.nix
./nixos/cad.nix
./nixos/gaming.nix
]; ];
}; };
hearth = nixpkgs.lib.nixosSystem { hearth = nixpkgs.lib.nixosSystem {
@ -147,12 +158,12 @@
# Standalone home-manager configuration entrypoint # Standalone home-manager configuration entrypoint
# Available through 'home-manager --flake .#your-username@your-hostname' # Available through 'home-manager --flake .#your-username@your-hostname'
homeConfigurations = { homeConfigurations = {
"traverseda@athame" = home-manager.lib.homeManagerConfiguration { "traverseda@generic" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
extraSpecialArgs = {inherit inputs outputs;}; extraSpecialArgs = {inherit inputs outputs;};
modules = [ modules = [
# > Our main home-manager configuration file < # > Our main home-manager configuration file <
./home-manager/home.nix ./home-manager/traverseda/home.nix
]; ];
}; };
}; };

View File

@ -10,14 +10,7 @@
}: { }: {
# You can import other home-manager modules here # You can import other home-manager modules here
imports = [ imports = [
# If you want to use modules your own flake exports (from modules/home-manager): inputs.nixvim.homeManagerModules.nixvim
# outputs.homeManagerModules.example
# Or modules exported from other flakes (such as nix-colors):
# inputs.nix-colors.homeManagerModules.default
# You can also split up your configuration and import pieces of it here:
# ./nvim.nix
]; ];
nixpkgs = { nixpkgs = {
@ -73,22 +66,53 @@
credential = { credential = {
helper = "cache --timeout=3600"; # Cache credentials for 1 hour (3600 seconds) helper = "cache --timeout=3600"; # Cache credentials for 1 hour (3600 seconds)
}; };
oh-my-zsh = {
"hide-dirty" = "1";
};
init = {
defaultBranch = "main";
};
}; };
}; };
programs.neovim = { programs.nixvim = {
enable = true; enable = true;
defaultEditor = true; defaultEditor = true;
viAlias = true; viAlias = true;
vimAlias = true; vimAlias = true;
vimdiffAlias = true; plugins.bufferline.enable = true;
plugins = with pkgs.vimPlugins; [ plugins.which-key.enable = true;
nvim-lspconfig
nvim-treesitter.withAllGrammars plugins.cmp-tabby = {
vim-bufferline enable = true;
tokyonight-nvim host = "localhost:8337";
};
globals.mapleader = " ";
keymaps = [
{ {
plugin = which-key-nvim; mode = "n";
key = "<C-a>c";
options = { noremap = true; desc = "Open new terminal"; };
action = "<cmd>:term<cr>";
}
{
mode = "n";
key = "<C-a>x";
options = { noremap = true; desc = "Close tab"; };
action = "<cmd>:bd<cr>";
}
{
mode = "n";
key = "<C-a>s";
options = { noremap = true; desc = "Pick buffer"; };
action = "<cmd>:BufferLinePick<CR>";
}
{
mode = "t";
key = "<Esc><Esc>";
options = { noremap = true; };
action = "<C-\\><C-n>";
} }
]; ];
}; };
@ -128,19 +152,14 @@
pkgs.wget pkgs.wget
pkgs.wl-clipboard pkgs.wl-clipboard
pkgs.atool pkgs.atool
pkgs.zig
pkgs.comma
(pkgs.nerdfonts.override { fonts = [ "FiraCode" "DroidSansMono" "Hack"]; }) (pkgs.nerdfonts.override { fonts = [ "FiraCode" "DroidSansMono" "Hack"]; })
(pkgs.writeShellScriptBin "nvr-edit" '' (pkgs.writeShellScriptBin "nvr-edit" ''
nvr --remote-wait $@ nvr --remote-wait $@
'') '')
(pkgs.writeShellScriptBin "nvidia-offload" ''
export __NV_PRIME_RENDER_OFFLOAD=1
export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0
export __GLX_VENDOR_LIBRARY_NAME=nvidia
export __VK_LAYER_NV_optimus=NVIDIA_only
exec "$@"
'')
]; ];
programs.zsh = { programs.zsh = {

View File

@ -0,0 +1,66 @@
{
inputs,
outputs,
lib,
config,
pkgs,
...
}:
{
imports = [
inputs.plasma-manager.homeManagerModules.plasma-manager
];
programs.plasma = {
enable = true;
# workspace = {
# theme = "breeze-dark";
# colorScheme = "BreezeDark";
# };
shortcuts = {
"services/org.kde.konsole.desktop"."_launch" = ["Meta+Return" "Ctrl+Alt+T"];
"kwin"."Window Close" = ["Meta+Shift+C" "Alt+F4"];
"kwin"."Cube" = "Meta+C";
};
shortcuts.plasmashell = {
"activate task manager entry 1" = "";
"activate task manager entry 2" = "";
"activate task manager entry 3" = "";
"activate task manager entry 4" = "";
"activate task manager entry 5" = "";
"activate task manager entry 6" = "";
"activate task manager entry 7" = "";
"activate task manager entry 8" = "";
"activate task manager entry 9" = "";
};
shortcuts.kwin = {
"Switch to Desktop 1" = "Meta+1";
"Window to Desktop 1" = "Meta+!";
"Switch to Desktop 2" = "Meta+2";
"Window to Desktop 2" = "Meta+@";
"Switch to Desktop 3" = "Meta+3";
"Window to Desktop 3" = "Meta+#";
"Switch to Desktop 4" = "Meta+4";
"Window to Desktop 4" = "Meta+$";
"Switch to Desktop 5" = "Meta+5";
"Window to Desktop 5" = "Meta+%";
"Switch to Desktop 6" = "Meta+6";
"Window to Desktop 6" = "Meta+^";
"Switch to Desktop 7" = "Meta+7";
"Window to Desktop 7" = "Meta+&";
"Switch to Desktop 8" = "Meta+8";
"Window to Desktop 8" = "Meta+*";
"Switch to Desktop 9" = "Meta+9";
"Window to Desktop 9" = "Meta+(";
"Switch to Desktop 10" = "Meta+0";
"Window to Desktop 10" = "Meta+)";
};
configFile = {
"kwinrc"."Desktops"."Number"."value" = 10;
"kwinrc"."Desktops"."Rows"."value" = 2;
"kwinrc"."Plugins"."cubeEnabled" = true;
"kwinrc"."Windows"."FocusPolicy" = "FocusFollowsMouse";
};
};
}

View File

@ -1,10 +1,10 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
{ {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
pkgs.openscad pkgs.openscad
pkgs.blender pkgs.blender
#pkgs.py-slvs
pkgs.freecad pkgs.freecad
(pkgs.appimageTools.wrapType2 (pkgs.appimageTools.wrapType2
{ {

View File

@ -76,10 +76,16 @@
#Deduplicate nix store on a timer #Deduplicate nix store on a timer
nix.optimise.automatic = true; nix.optimise.automatic = true;
programs.neovim = {
enable = true;
defaultEditor = true;
viAlias = true;
vimAlias = true;
};
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
# wget # wget
pkgs.neovim
pkgs.mosh pkgs.mosh
pkgs.git pkgs.git
pkgs.usbutils pkgs.usbutils
@ -133,7 +139,7 @@
extraSpecialArgs = { inherit inputs outputs; }; extraSpecialArgs = { inherit inputs outputs; };
backupFileExtension = ".bak"; backupFileExtension = ".bak";
users = { users = {
traverseda = import ../home-manager/home.nix; traverseda = import ../home-manager/traverseda/home.nix;
}; };
}; };

View File

@ -14,6 +14,10 @@ in
isNormalUser = true; isNormalUser = true;
extraGroups = [ "networkManager" ]; extraGroups = [ "networkManager" ];
}; };
ingrid = {
isNormalUser = true;
extraGroups = [ "networkManager" ];
};
bill = { bill = {
isNormalUser = true; isNormalUser = true;
extraGroups = [ "networkManager" ]; extraGroups = [ "networkManager" ];

40
nixos/hardware/ariel.nix Normal file
View File

@ -0,0 +1,40 @@
# 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, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/fe5ec606-9052-463e-b402-e37dd206b87f";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/C746-7DF9";
fsType = "vfat";
};
swapDevices =
[ { device = "/dev/disk/by-uuid/654049ca-318f-453d-ad70-9d2a35d42a6d"; }
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp1s0.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp2s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View File

@ -1,4 +1,4 @@
{ config, pkgs, lib, ... }: { inputs, outputs, lib, config, pkgs, hostname, specialArgs, options, ... }:
{ {
# Enable the KDE Desktop Environment. # Enable the KDE Desktop Environment.
@ -7,6 +7,9 @@
services.desktopManager.plasma6.enable = true; services.desktopManager.plasma6.enable = true;
services.displayManager.sddm.wayland.enable = true; services.displayManager.sddm.wayland.enable = true;
services.displayManager.defaultSession = "plasma"; services.displayManager.defaultSession = "plasma";
services.displayManager = {
autoLogin.enable = lib.mkDefault false;
};
services.flatpak.enable = true; services.flatpak.enable = true;
services.packagekit.enable = true; services.packagekit.enable = true;
@ -76,6 +79,14 @@ programs.dconf.enable = true;
hardware.bluetooth.enable = true; hardware.bluetooth.enable = true;
hardware.bluetooth.powerOnBoot = true; hardware.bluetooth.powerOnBoot = true;
home-manager = {
extraSpecialArgs = { inherit inputs outputs; };
backupFileExtension = ".bak";
users = {
traverseda = import ../home-manager/traverseda/kde-desktop.nix;
};
};
#Enable support for my logitech bluetooth peripherals #Enable support for my logitech bluetooth peripherals
hardware.logitech.wireless.enable = true; hardware.logitech.wireless.enable = true;
hardware.logitech.wireless.enableGraphical = true; hardware.logitech.wireless.enableGraphical = true;

View File

@ -6,6 +6,7 @@
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
pkgs.qgroundcontrol pkgs.qgroundcontrol
pkgs.zig
pkgs.distrobox pkgs.distrobox
pkgs.element-desktop pkgs.element-desktop
pkgs.act pkgs.act

View File

@ -0,0 +1,57 @@
{
description = "Blender CAD Sketcher";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = {
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = nixpkgs.legacyPackages.${system};
in {
devShells.default = pkgs.mkShell {
shellHook = ''
'';
packages = [
(
let
py-slvs = pythonPkgs:
pythonPkgs.buildPythonPackage rec {
pname = "py-slvs";
version = "1.0.6";
src = pythonPkgs.fetchPypi {
pname = "py_slvs";
version = "1.0.6";
sha256 = "sha256-U6T/aXy0JTC1ptL5oBmch0ytSPmIkRA8XOi31NpArnI=";
};
nativeBuildInputs = with pkgs; [swig];
pyproject = true;
propagatedBuildInputs = with pythonPkgs; [
cmake
ninja
setuptools
scikit-build
];
dontUseCmakeConfigure = true;
meta = with pkgs.lib; {
description = "Python binding of SOLVESPACE geometry constraint solver";
homepage = "https://github.com/realthunder/slvs_py";
license = licenses.gpl3;
};
};
blenderCadSketcher = pkgs.blender.withPackages (p: [(py-slvs p)]);
in
blenderCadSketcher
)
];
};
});
}

View File

@ -6,4 +6,5 @@
{ {
# example = pkgs.callPackage ./example { }; # example = pkgs.callPackage ./example { };
creality-print = pkgs.callPackage ./creality-print { }; creality-print = pkgs.callPackage ./creality-print { };
py-slvs = pkgs.callPackage ./py-slvs { };
} }

57
pkgs/py-slvs/default.nix Normal file
View File

@ -0,0 +1,57 @@
{
description = "Blender CAD Sketcher";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = {
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = nixpkgs.legacyPackages.${system};
in {
devShells.default = pkgs.mkShell {
shellHook = ''
'';
packages = [
(
let
py-slvs = pythonPkgs:
pythonPkgs.buildPythonPackage rec {
pname = "py-slvs";
version = "1.0.6";
src = pythonPkgs.fetchPypi {
pname = "py_slvs";
version = "1.0.6";
sha256 = "sha256-U6T/aXy0JTC1ptL5oBmch0ytSPmIkRA8XOi31NpArnI=";
};
nativeBuildInputs = with pkgs; [swig];
pyproject = true;
propagatedBuildInputs = with pythonPkgs; [
cmake
ninja
setuptools
scikit-build
];
dontUseCmakeConfigure = true;
meta = with pkgs.lib; {
description = "Python binding of SOLVESPACE geometry constraint solver";
homepage = "https://github.com/realthunder/slvs_py";
license = licenses.gpl3;
};
};
blenderWithPySlvs = pkgs.blender.withPackages (p: [(py-slvs p)]);
in
blenderWithPySlvs
)
];
};
});
}