Committed after home build
diff --git a/flake.lock b/flake.lock
new file mode 100644
index 0000000..2d76016
--- /dev/null
+++ b/flake.lock
@@ -0,0 +1,48 @@
+{
+  "nodes": {
+    "home-manager": {
+      "inputs": {
+        "nixpkgs": [
+          "nixpkgs"
+        ]
+      },
+      "locked": {
+        "lastModified": 1639871969,
+        "narHash": "sha256-6feWUnMygRzA9tzkrfAzpA5/NBYg75bkFxnqb1DtD7E=",
+        "owner": "nix-community",
+        "repo": "home-manager",
+        "rev": "697cc8c68ed6a606296efbbe9614c32537078756",
+        "type": "github"
+      },
+      "original": {
+        "owner": "nix-community",
+        "ref": "release-21.11",
+        "repo": "home-manager",
+        "type": "github"
+      }
+    },
+    "nixpkgs": {
+      "locked": {
+        "lastModified": 1640077788,
+        "narHash": "sha256-YMSDk3hlucJTTARaHNOeQEF6zEW3A/x4sXgrz94VbS0=",
+        "owner": "NixOS",
+        "repo": "nixpkgs",
+        "rev": "9ab7d12287ced0e1b4c03b61c781901f178d9d77",
+        "type": "github"
+      },
+      "original": {
+        "id": "nixpkgs",
+        "ref": "nixos-21.11",
+        "type": "indirect"
+      }
+    },
+    "root": {
+      "inputs": {
+        "home-manager": "home-manager",
+        "nixpkgs": "nixpkgs"
+      }
+    }
+  },
+  "root": "root",
+  "version": 7
+}
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..be45d5b
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,57 @@
+{
+  description = "Minion3665's NixFiles (@Python)";
+
+  inputs = {
+    # Set our release channels
+    nixpkgs.url = "nixpkgs/nixos-21.11";
+    home-manager.url = "github:nix-community/home-manager/release-21.11";
+
+    # Make sure flakes we depend on use the same version of nixpkgs as we do
+    home-manager.inputs.nixpkgs.follows = "nixpkgs";
+  };
+
+  outputs = { nixpkgs, home-manager, ... }:
+  let
+    system = "x86_64-linux";
+
+    # Convert nixpkgs to pkgs
+    pkgs = import nixpkgs {
+      inherit system;
+
+      config = { allowUnfree = true; };
+    };
+
+    # Nixpkgs helper functions
+    lib = nixpkgs.lib;
+  in {
+    # Create a system config from our old config file
+    nixosConfigurations = {
+      python = lib.nixosSystem {
+        inherit system;
+
+        modules = [
+          ./system/configuration.nix
+        ];
+      };
+    };
+
+    # This doesn't have to be called this; home-manager doesn't have a specified way to do this
+    # This solution is from https://www.youtube.com/watch?v=mJbQ--iBc1U
+    homeManagerConfigurations = {
+      minion = home-manager.lib.homeManagerConfiguration {
+        inherit system pkgs;
+	
+        username = "minion";
+	homeDirectory = "/home/minion";
+
+        configuration = {
+          imports = [
+            ./users/minion/home.nix
+          ];
+        };
+
+        stateVersion = "21.11";
+      };
+    };
+  };
+}
diff --git a/scripts/update-home b/scripts/update-home
index 71d853a..a17b0c9 100755
--- a/scripts/update-home
+++ b/scripts/update-home
@@ -1,5 +1,6 @@
 #!/bin/sh
 
 cd "$(dirname ${BASH_SOURCE[0]})/.."
-
-home-manager switch -f ./users/minion/home.nix
+nix build .#homeManagerConfigurations.minion.activationPackage
+./result/activate
+scripts/commit home
diff --git a/scripts/update-nix b/scripts/update-nix
index 7ea7705..9b7111d 100755
--- a/scripts/update-nix
+++ b/scripts/update-nix
@@ -2,4 +2,5 @@
 
 cd "$(dirname ${BASH_SOURCE[0]})/.."
 
-sudo nixos-rebuild switch -I nixos-config=./system/configuration.nix
+sudo nixos-rebuild switch --flake .#
+scripts/commit system
diff --git a/scripts/upgrade-home b/scripts/upgrade-home
index 2b74d7e..0f5cd27 100755
--- a/scripts/upgrade-home
+++ b/scripts/upgrade-home
@@ -1,5 +1,5 @@
 #!/bin/sh
 
 cd "$(dirname ${BASH_SOURCE[0]})/.."
-nix-channel --update
-home-manager switch -f ./users/minion/home.nix
+nix flake update
+scripts/update-home
diff --git a/scripts/upgrade-nix b/scripts/upgrade-nix
index ff73187..51ae11e 100755
--- a/scripts/upgrade-nix
+++ b/scripts/upgrade-nix
@@ -1,5 +1,5 @@
 #!/bin/sh
 
 cd "$(dirname ${BASH_SOURCE[0]})/.."
-sudo nix-channel --update
+nix flake update
 sudo scripts/update-nix
diff --git a/secrets/networking-configuration.nix b/secrets/networking-configuration.nix
index 746756d..92d2c66 100644
--- a/secrets/networking-configuration.nix
+++ b/secrets/networking-configuration.nix
Binary files differ
diff --git a/system/configuration.nix b/system/configuration.nix
index 0ee41b4..c51c411 100644
--- a/system/configuration.nix
+++ b/system/configuration.nix
@@ -13,6 +13,14 @@
 #      ./eduroam.nix
     ];
 
+  # Prepare nix flakes
+  nix = {
+    package = pkgs.nixFlakes;
+    extraOptions = ''
+      experimental-features = nix-command flakes
+    '';
+  };
+
   # Use the systemd-boot EFI boot loader.
   boot.loader.systemd-boot.enable = true;
   boot.loader.efi.canTouchEfiVariables = true;
@@ -157,6 +165,7 @@
   services.keybase.enable = true;
   services.gnome.gnome-keyring.enable = true;
   services.i2p.enable = true;
+  virtualisation.docker.enable = true;
 
   # This value determines the NixOS release from which the default
   # settings for stateful data, like file locations and database versions
diff --git a/users/minion/config.nix b/users/minion/config.nix
deleted file mode 100644
index 69baf10..0000000
--- a/users/minion/config.nix
+++ /dev/null
@@ -1 +0,0 @@
-{ allowUnfree = true; }
diff --git a/users/minion/home.nix b/users/minion/home.nix
index 1c62898..52abfc0 100644
--- a/users/minion/home.nix
+++ b/users/minion/home.nix
@@ -23,6 +23,10 @@
     steam-tui steam-run
     minecraft
     git-crypt gnupg pinentry_qt
+    spotify
+    keepassxc
+    grim slurp
+    neovim
   ];
 
   programs.git = {