F26DJCZ7RLGRDZSYACB6MGMNTW7L5FE332EBYEIJTBRK7QJ6ZIYAC
# My Nix configuration
nixosConfigurations.virtualBox = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
./nixos/virtualBox.nix
({ ... }: { nixpkgs.overlays = [ fenix.overlay ]; })
home-manager.nixosModules.home-manager {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.${username} = hmConfig {
rust = true;
sway = true;
};
}
];
};
{ config, pkgs, fenix, ... }:
let
rustToolchain = pkgs.fenix.complete.withComponents [
"cargo"
"clippy"
"llvm-tools-preview"
"rust-analyzer-preview"
"rust-src"
"rust-std"
"rustc"
"rustfmt"
];
in {
nixpkgs.overlays = [ fenix.overlay ];
{ config, pkgs, ... }:
home.packages = with pkgs; [ bintools clang lldb rustToolchain mold ];
home.file.".cargo/config.toml".source =
(pkgs.formats.toml { }).generate "cargo-config" {
target.x86_64-unknown-linux-gnu = {
linker = "clang";
rustflags = [ "-C" "link-arg=-fuse-ld=${pkgs.mold}/bin/mold" ];
};
};
{ pkgs, fenix ? null, ... }:
let
rustToolchain = pkgs.fenix.complete.withComponents [
"cargo"
"clippy"
"llvm-tools-preview"
"rust-analyzer-preview"
"rust-src"
"rust-std"
"rustc"
"rustfmt"
];
in {
nixpkgs.overlays = if isNull fenix then [] else [ fenix.overlay ];
home.packages = with pkgs; [ bintools clang lldb rustToolchain mold ];
home.file.".cargo/config.toml".source =
(pkgs.formats.toml { }).generate "cargo-config" {
target.x86_64-unknown-linux-gnu = {
linker = "clang";
rustflags = [ "-C" "link-arg=-fuse-ld=${pkgs.mold}/bin/mold" ];
};
};
programs.helix = {
languages = [{
name = "rust";
language-server = { command = "${rustToolchain}/bin/rust-analyzer"; };
}];
};
}
{ lib, pkgs, ... }:
let
dbus-sway-environment = pkgs.writeTextFile {
name = "dbus-sway-env";
executable = true;
text = ''
dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway
systemctl --user stop pipewire pipewire-media-session xdg-desktop-portal xdg-desktop-portal-wlr
systemctl --user start pipewire pipewire-media-session xdg-desktop-portal xdg-desktop-portal-wlr
'';
};
in {
programs.foot.enable = true;
wayland.windowManager.sway = {
enable = true;
config = {
modifier = "Mod4";
menu = "";
terminal = "${pkgs.foot}/bin/foot";
startup = [
{ command = "${dbus-sway-environment}"; }
];
};
};
services.kanshi.enable = true;
home.sessionVariables.WLR_NO_HARDWARE_CURSORS = 1;
}
{ config, pkgs, ... }:
{
nix = {
package = pkgs.nixUnstable;
extraOptions = ''
experimental-features = nix-command flakes
'';
};
time.timeZone = "Europe/Warsaw";
users.users.nixos = {
isNormalUser = true;
extraGroups = [ "wheel" ];
shell = pkgs.fish;
};
system.stateVersion = "22.05";
}
{ pkgs, ... }:
{
services.pipewire = {
enable = true;
alsa.enable = true;
pulse.enable = true;
};
services.dbus.enable = true;
xdg.portal = {
enable = true;
wlr.enable = true;
extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
gtkUsePortal = true;
};
programs.sway.enable = true;
}
{ config, lib, pkgs, ... }:
{
imports =
[
./common.nix
./sway.nix
];
boot.loader.grub.enable = true;
boot.loader.grub.version = 2;
boot.loader.grub.device = "/dev/sda";
boot.initrd.checkJournalingFS = false;
boot.initrd.availableKernelModules = [ "ata_piix" "ohci_pci" "ehci_pci" "sd_mod" "sr_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/66f65e77-6f5f-42f8-b10f-bca2f40874dd";
fsType = "ext4";
};
fileSystems."/nikod" = {
device = "nikod";
fsType = "vboxsf";
options = [ "rw" "nofail" ];
};
swapDevices = [ ];
# 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.enp0s3.useDHCP = lib.mkDefault true;
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
virtualisation.virtualbox.guest.enable = true;
}