Compare commits

..

No commits in common. "main" and "flaked" have entirely different histories.
main ... flaked

16 changed files with 130 additions and 186 deletions

63
flake.lock generated
View file

@ -1,63 +0,0 @@
{
"nodes": {
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1710532761,
"narHash": "sha256-SUXGZNrXX05YA9G6EmgupxhOr3swI1gcxLUeDMUhrEY=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "206f457fffdb9a73596a4cb2211a471bd305243d",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1710451336,
"narHash": "sha256-pP86Pcfu3BrAvRO7R64x7hs+GaQrjFes+mEPowCfkxY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "d691274a972b3165335d261cc4671335f5c67de9",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-unstable",
"type": "indirect"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1710420202,
"narHash": "sha256-MvFKESbq4rUWuaf2RKPNYENaSZEw/jaCLo2gU6oREcM=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "878ef7d9721bee9f81f8a80819f9211ad1f993da",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-23.11",
"type": "indirect"
}
},
"root": {
"inputs": {
"home-manager": "home-manager",
"nixpkgs": "nixpkgs",
"nixpkgs-stable": "nixpkgs-stable"
}
}
},
"root": "root",
"version": 7
}

View file

@ -1,42 +0,0 @@
{
description = "polygon's computer mess";
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
nixpkgs-stable.url = "nixpkgs/nixos-23.11";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
self,
nixpkgs,
nixpkgs-stable,
home-manager,
...
} @ inputs: let
pkgs = nixpkgs.legacyPackages."x86_64-linux";
system = "x86_64-linux";
in {
nixosConfigurations = {
twinkpad = nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs;
};
inherit system;
modules = [
./hosts/twinkpad/configuration.nix
home-manager.nixosModules.home-manager {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.polygon = import ./home-manager/desktop/home.nix;
}
];
};
};
};
}

48
home-manager/desktop/flake.lock generated Normal file
View file

@ -0,0 +1,48 @@
{
"nodes": {
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1710062421,
"narHash": "sha256-FiCNRfyUgJOLYIokLiFsfI7B+Zn9HDnOzFR3uVr5qsQ=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "36f873dfc8e2b6b89936ff3e2b74803d50447e0a",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1709961763,
"narHash": "sha256-6H95HGJHhEZtyYA3rIQpvamMKAGoa8Yh2rFV29QnuGw=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "3030f185ba6a4bf4f18b87f345f104e6a6961f34",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"home-manager": "home-manager",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

View file

@ -0,0 +1,29 @@
{
description = "Home Manager configuration of polygon";
inputs = {
# Specify the source of Home Manager and Nixpkgs.
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { nixpkgs, home-manager, ... }:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
in {
homeConfigurations."polygon" = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
# Specify your home configuration modules here, for example,
# the path to your home.nix.
modules = [ ./home.nix ];
# Optionally use extraSpecialArgs
# to pass through arguments to home.nix
};
};
}

View file

@ -13,6 +13,7 @@
# You should not change this value, even if you update Home Manager. If you do # You should not change this value, even if you update Home Manager. If you do
# want to update the value, then make sure to first check the Home Manager # want to update the value, then make sure to first check the Home Manager
# release notes. # release notes.
home.stateVersion = "23.11"; # Please read the comment before changing.
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
# The home.packages option allows you to install Nix packages into your # The home.packages option allows you to install Nix packages into your
# environment. # environment.
@ -23,15 +24,6 @@
hexchat hexchat
steam steam
keepassxc keepassxc
syncthing
kdeconnect
htop
nmap
tmux
hyfetch
stremio
spotify
godot3
]; ];
programs = { programs = {
@ -97,11 +89,9 @@
# /etc/profiles/per-user/polygon/etc/profile.d/hm-session-vars.sh # /etc/profiles/per-user/polygon/etc/profile.d/hm-session-vars.sh
# #
home.sessionVariables = { home.sessionVariables = {
EDITOR = "nvim"; EDITOR = "neovim";
}; };
# Let Home Manager install and manage itself. # Let Home Manager install and manage itself.
programs.home-manager.enable = true; programs.home-manager.enable = true;
home.sessionVariables.TZ = "Europe/Berlin";
home.stateVersion = "23.11";
} }

5
hosts/common/default.nix Normal file
View file

@ -0,0 +1,5 @@
{
imports = [
./sound.nix
];
}

View file

@ -5,7 +5,7 @@
}: }:
{ {
i18n.defaultLocale = "de_DE.UTF-8"; i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = { i18n.extraLocaleSettings = {
LC_ADDRESS = "de_DE.UTF-8"; LC_ADDRESS = "de_DE.UTF-8";
@ -20,8 +20,5 @@
}; };
time.timeZone = "Europe/Berlin"; time.timeZone = "Europe/Berlin";
console = { console.keyMap = "de";
earlySetup = true;
keyMap = "de";
};
} }

View file

@ -1,4 +1,8 @@
{ config, pkgs, ... }: {
config,
pkgs,
...
}:
{ {
sound.enable = true; sound.enable = true;

View file

@ -8,8 +8,7 @@
imports = imports =
[ # Include the results of the hardware scan. [ # Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
./../../modules/common ./../common
./../../modules/desktop
]; ];
# enable flakes # enable flakes
nix.settings.experimental-features = [ "nix-command" "flakes" ]; nix.settings.experimental-features = [ "nix-command" "flakes" ];
@ -23,6 +22,7 @@
networking.networkmanager.enable = true; networking.networkmanager.enable = true;
environment.pathsToLink = [ "/share/zsh" ]; environment.pathsToLink = [ "/share/zsh" ];
environment.shells = [ "/home/polygon/.nix-profile/bin/zsh" ]; environment.shells = [ "/home/polygon/.nix-profile/bin/zsh" ];
# Set your time zone.
# Enable the X11 windowing system. # Enable the X11 windowing system.
services.xserver.enable = true; services.xserver.enable = true;
@ -42,6 +42,7 @@
# Enable CUPS to print documents. # Enable CUPS to print documents.
services.printing.enable = true; services.printing.enable = true;
# Define a user account. Don't forget to set a password with passwd. # Define a user account. Don't forget to set a password with passwd.
users.users.polygon = { users.users.polygon = {
isNormalUser = true; isNormalUser = true;
@ -59,6 +60,8 @@
# List packages installed in system profile. To search, run: # List packages installed in system profile. To search, run:
# $ nix search wget # $ nix search wget
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
neovim
wget
kitty kitty
]; ];

View file

@ -1,10 +0,0 @@
upgrade: update build
test:
sudo nixos-rebuild test --flake . --impure --fast
build:
sudo nixos-rebuild switch --flake . --impure --fast
update:
nix flake update --commit-lock-file

View file

@ -1,13 +0,0 @@
{pkgs, config, ...}:
{
imports = [
./locales.nix
];
environment.systemPackages = with pkgs; [
git
just
neovim
wget
];
}

View file

@ -1,7 +0,0 @@
{
imports = [
./sound.nix
./syncthing.nix
./firewall.nix
];
}

View file

@ -1,17 +0,0 @@
{ config, pkgs, ... }:
{
networking.firewall = {
enable = false;
allowedUDPPorts = [53];
allowedTCPPorts = [53 22 22067 22070];
allowedTCPPortRanges = [
{ from = 1714; to = 1764; } # KDE Connect
];
allowedUDPPortRanges = [
{ from = 1714; to = 1764; } # KDE Connect
];
};
}

View file

@ -1,14 +0,0 @@
{ config, pkgs, ... }:
{
services.syncthing = {
enable = true;
relay.enable = true;
user = "polygon";
dataDir = "/home/polygon/syncthing";
configDir = "/home/polygon/.config/syncthing";
};
}

34
scripts/setup.sh Executable file
View file

@ -0,0 +1,34 @@
#!/bin/sh
echo "Select a machine:"
select machine in machines/*; do
if [ -n "$machine" ]; then
break
else
echo "Invalid selection."
fi
done
sudo mv /etc/nixos /etc/nixos.bak
sudo mkdir /etc/nixos
sudo ln -s "$(pwd)/$machine/*" /etc/nixos
read -p "Do you want to symlink home-manager? (y/n): " symlinkHomeManager
if [ "$symlinkHomeManager" = "y" ] || [ "$symlinkHomeManager" = "Y" ]; then
echo -e "\nSelect a home manager configuration:"
select config in home-manager/*; do
if [ -n "$config" ]; then
break
else
echo "Invalid selection."
fi
done
mv ~/.config/home-manager ~/.config/home-manager.bak
ln -s "$(pwd)/$config" ~/.config/home-manager
else
echo "Skipped symlink for home-manager"
fi
echo "Task completed successfully."