aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaroline Larimore <caroline@larimo.re>2024-07-19 00:01:14 -0700
committerCaroline Larimore <caroline@larimo.re>2024-07-19 00:01:14 -0700
commit8976441188db64b5bcd0def77874968a03ac51a5 (patch)
tree6700c80f2f54f6e03f630cf5899ba6aa749b7538
parent65174b4b5c05bb143e6681a4cbcd0a95f04987e2 (diff)
Create core module
-rw-r--r--core/default.nix8
-rw-r--r--core/env.nix23
-rw-r--r--core/packages.nix10
-rw-r--r--hosts/c-pc/configuration.nix27
-rw-r--r--hosts/copenhagen/configuration.nix31
5 files changed, 43 insertions, 56 deletions
diff --git a/core/default.nix b/core/default.nix
new file mode 100644
index 0000000..9ea2247
--- /dev/null
+++ b/core/default.nix
@@ -0,0 +1,8 @@
+{ ... }:
+
+{
+ imports = [
+ ./env.nix
+ ./packages.nix
+ ];
+}
diff --git a/core/env.nix b/core/env.nix
new file mode 100644
index 0000000..2fbf55e
--- /dev/null
+++ b/core/env.nix
@@ -0,0 +1,23 @@
+{ pkgs, ... }:
+
+{
+ environment = {
+ localBinInPath = true;
+
+ #TODO: migrate to writeShellScriptBin
+ interactiveShellInit = ''
+ alias lsa="ls -lAsh"
+ alias c="codium ."
+ alias p="nix-shell -p"
+
+ mkcd() {
+ mkdir -p "$1"
+ cd "$1"
+ }
+ '';
+
+ variables = {
+ EDITOR = "${pkgs.vim}/bin/vim";
+ };
+ };
+}
diff --git a/core/packages.nix b/core/packages.nix
new file mode 100644
index 0000000..bf30787
--- /dev/null
+++ b/core/packages.nix
@@ -0,0 +1,10 @@
+{ pkgs, ... }:
+
+{
+ environment.systemPackages = with pkgs; [
+ git
+ vim
+ wget
+ killall
+ ];
+}
diff --git a/hosts/c-pc/configuration.nix b/hosts/c-pc/configuration.nix
index 73797ea..a0ce408 100644
--- a/hosts/c-pc/configuration.nix
+++ b/hosts/c-pc/configuration.nix
@@ -4,6 +4,7 @@
imports = [
./hardware-configuration.nix
./networking.nix
+ ../../core
../../roles
];
@@ -32,27 +33,6 @@
};
};
- environment = {
- localBinInPath = true;
-
- interactiveShellInit = ''
- alias kitty-ssh="kitty +kitten ssh"
-
- alias lsa="ls -lAsh"
- alias c="codium ."
- alias p="nix-shell -p"
-
- mkcd() {
- mkdir -p "$1"
- cd "$1"
- }
- '';
-
- variables = {
- EDITOR = "${pkgs.vim}/bin/vim";
- };
- };
-
time.timeZone = "America/Los_Angeles";
users.users = {
@@ -96,9 +76,6 @@
(writeShellScriptBin "rbf" "sudo nixos-rebuild switch --flake path:/etc/nixos#default")
(writeShellScriptBin "toys" "nix-shell -p cmatrix asciiquarium pipes cowsay figlet neofetch")
- git
- vim
- wget
firefox
wineWowPackages.stable
winetricks
@@ -108,8 +85,6 @@
ffmpeg
jellyfin
-
- killall
go
jdk21
diff --git a/hosts/copenhagen/configuration.nix b/hosts/copenhagen/configuration.nix
index 21a2e98..d05d9a0 100644
--- a/hosts/copenhagen/configuration.nix
+++ b/hosts/copenhagen/configuration.nix
@@ -3,6 +3,7 @@
{
imports = [
./hardware-configuration.nix
+ ../../core
../../roles
];
@@ -11,32 +12,6 @@
networking.hostName = "copenhagen";
time.timeZone = "America/Los_Angeles";
- # home-manager = {
- # extraSpecialArgs = { inherit inputs; };
- # users = {
- # "c" = import ./home.nix;
- # };
- # };
-
- environment = {
- localBinInPath = true;
-
- interactiveShellInit = ''
- alias lsa="ls -lAsh"
- alias c="codium ."
- alias p="nix-shell -p"
-
- mkcd() {
- mkdir -p "$1"
- cd "$1"
- }
- '';
-
- variables = {
- EDITOR = "${pkgs.vim}/bin/vim";
- };
- };
-
users.users = {
root.password = "password";
@@ -51,10 +26,6 @@
(writeShellScriptBin "rb" "sudo nixos-rebuild switch --flake /etc/nixos#copenhagen")
(writeShellScriptBin "rbf" "sudo nixos-rebuild switch --flake path:/etc/nixos#copenhagen")
- git
- vim
- wget
- killall
ffmpeg
];